diff --git a/Greenshot/Destinations/EditorDestination.cs b/Greenshot/Destinations/EditorDestination.cs index 8cfb8c13d..e797ee403 100644 --- a/Greenshot/Destinations/EditorDestination.cs +++ b/Greenshot/Destinations/EditorDestination.cs @@ -45,13 +45,9 @@ namespace Greenshot.Destinations { this.editor = editor; } - public override string Designation { - get { - return DESIGNATION; - } - } + public override string Designation => DESIGNATION; - public override string Description { + public override string Description { get { if (editor == null) { return Language.GetString(LangKey.settings_destination_editor); @@ -60,25 +56,13 @@ namespace Greenshot.Destinations { } } - public override int Priority { - get { - return 1; - } - } + public override int Priority => 1; - public override bool IsDynamic { - get { - return true; - } - } + public override bool IsDynamic => true; - public override Image DisplayIcon { - get { - return greenshotIcon; - } - } + public override Image DisplayIcon => greenshotIcon; - public override IEnumerable DynamicDestinations() { + public override IEnumerable DynamicDestinations() { foreach (IImageEditor someEditor in ImageEditorForm.Editors) { yield return new EditorDestination(someEditor); } @@ -94,12 +78,12 @@ namespace Greenshot.Destinations { if (editor == null) { if (editorConfiguration.ReuseEditor) { foreach(IImageEditor openedEditor in ImageEditorForm.Editors) { - if (!openedEditor.Surface.Modified) { - openedEditor.Surface = surface; - exportInformation.ExportMade = true; - break; - } - } + if (openedEditor.Surface.Modified) continue; + + openedEditor.Surface = surface; + exportInformation.ExportMade = true; + break; + } } if (!exportInformation.ExportMade) { try { diff --git a/Greenshot/Destinations/EmailDestination.cs b/Greenshot/Destinations/EmailDestination.cs index 8483d7e2b..39f4dde64 100644 --- a/Greenshot/Destinations/EmailDestination.cs +++ b/Greenshot/Destinations/EmailDestination.cs @@ -39,26 +39,24 @@ namespace Greenshot.Destinations { static EmailDestination() { // Logic to decide what email implementation we use - if (EmailConfigHelper.HasMapi()) { - _isActiveFlag = false; - _mapiClient = EmailConfigHelper.GetMapiClient(); - if (!string.IsNullOrEmpty(_mapiClient)) { - // Active as we have a mapi client, can be disabled later - _isActiveFlag = true; - } - } - } + if (!EmailConfigHelper.HasMapi()) return; + + _isActiveFlag = false; + _mapiClient = EmailConfigHelper.GetMapiClient(); + if (!string.IsNullOrEmpty(_mapiClient)) { + // Active as we have a mapi client, can be disabled later + _isActiveFlag = true; + } + } public override string Designation => DESIGNATION; public override string Description { - get { - // Make sure there is some kind of "mail" name - if (_mapiClient == null) { - _mapiClient = Language.GetString(LangKey.editor_email); - } - return _mapiClient; - } + get + { + // Make sure there is some kind of "mail" name + return _mapiClient ??= Language.GetString(LangKey.editor_email); + } } public override int Priority => 3; diff --git a/Greenshot/Destinations/PrinterDestination.cs b/Greenshot/Destinations/PrinterDestination.cs index 66cf248bf..ae4581742 100644 --- a/Greenshot/Destinations/PrinterDestination.cs +++ b/Greenshot/Destinations/PrinterDestination.cs @@ -19,6 +19,7 @@ * along with this program. If not, see . */ +using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Printing; @@ -35,54 +36,34 @@ namespace Greenshot.Destinations { /// public class PrinterDestination : AbstractDestination { public const string DESIGNATION = "Printer"; - public readonly string printerName; + private readonly string _printerName; public PrinterDestination() { } public PrinterDestination(string printerName) { - this.printerName = printerName; - } - public override string Designation { - get { - return DESIGNATION; - } + _printerName = printerName; } + public override string Designation => DESIGNATION; - public override string Description { + public override string Description { get { - if (printerName != null) { - return Language.GetString(LangKey.settings_destination_printer) + " - " + printerName; + if (_printerName != null) { + return Language.GetString(LangKey.settings_destination_printer) + " - " + _printerName; } return Language.GetString(LangKey.settings_destination_printer); } } - public override int Priority { - get { - return 2; - } - } + public override int Priority => 2; - public override Keys EditorShortcutKeys { - get { - return Keys.Control | Keys.P; - } - } + public override Keys EditorShortcutKeys => Keys.Control | Keys.P; - public override Image DisplayIcon { - get { - return GreenshotResources.getImage("Printer.Image"); - } - } + public override Image DisplayIcon => GreenshotResources.getImage("Printer.Image"); - public override bool IsDynamic { - get { - return true; - } - } + public override bool IsDynamic => true; - /// + /// /// Create destinations for all the installed printers /// /// IEnumerable of IDestination @@ -101,7 +82,7 @@ namespace Greenshot.Destinations { if(defaultPrinter.Equals(p2)) { return 1; } - return p1.CompareTo(p2); + return string.Compare(p1, p2, StringComparison.Ordinal); }); foreach(string printer in printers) { yield return new PrinterDestination(printer); @@ -118,10 +99,10 @@ namespace Greenshot.Destinations { public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) { ExportInformation exportInformation = new ExportInformation(Designation, Description); PrinterSettings printerSettings; - if (!string.IsNullOrEmpty(printerName)) + if (!string.IsNullOrEmpty(_printerName)) { using PrintHelper printHelper = new PrintHelper(surface, captureDetails); - printerSettings = printHelper.PrintTo(printerName); + printerSettings = printHelper.PrintTo(_printerName); } else if (!manuallyInitiated) { PrinterSettings settings = new PrinterSettings(); using PrintHelper printHelper = new PrintHelper(surface, captureDetails); diff --git a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs index ce057a34e..b1efb78f3 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalDoublePercentageConverter.cs @@ -26,7 +26,7 @@ namespace Greenshot.Drawing.Fields.Binding { /// public class DecimalDoublePercentageConverter : AbstractBindingConverter { - private static DecimalDoublePercentageConverter uniqueInstance; + private static DecimalDoublePercentageConverter _uniqueInstance; private DecimalDoublePercentageConverter() {} @@ -38,10 +38,10 @@ namespace Greenshot.Drawing.Fields.Binding { return Convert.ToDouble(o)/100; } - public static DecimalDoublePercentageConverter GetInstance() { - if(uniqueInstance == null) uniqueInstance = new DecimalDoublePercentageConverter(); - return uniqueInstance; - } + public static DecimalDoublePercentageConverter GetInstance() + { + return _uniqueInstance ??= new DecimalDoublePercentageConverter(); + } } } diff --git a/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs index df44ab46a..b4a4283e4 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalFloatConverter.cs @@ -26,7 +26,7 @@ namespace Greenshot.Drawing.Fields.Binding { /// public class DecimalFloatConverter : AbstractBindingConverter { - private static DecimalFloatConverter uniqueInstance; + private static DecimalFloatConverter _uniqueInstance; private DecimalFloatConverter() {} @@ -38,10 +38,10 @@ namespace Greenshot.Drawing.Fields.Binding { return Convert.ToInt16(o); } - public static DecimalFloatConverter GetInstance() { - if(uniqueInstance == null) uniqueInstance = new DecimalFloatConverter(); - return uniqueInstance; - } + public static DecimalFloatConverter GetInstance() + { + return _uniqueInstance ??= new DecimalFloatConverter(); + } } } diff --git a/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs b/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs index b11768d25..d71d27528 100644 --- a/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs +++ b/Greenshot/Drawing/Fields/Binding/DecimalIntConverter.cs @@ -26,7 +26,7 @@ namespace Greenshot.Drawing.Fields.Binding { /// public class DecimalIntConverter : AbstractBindingConverter { - private static DecimalIntConverter uniqueInstance; + private static DecimalIntConverter _uniqueInstance; private DecimalIntConverter() {} @@ -38,10 +38,10 @@ namespace Greenshot.Drawing.Fields.Binding { return Convert.ToInt16(o); } - public static DecimalIntConverter GetInstance() { - if(uniqueInstance == null) uniqueInstance = new DecimalIntConverter(); - return uniqueInstance; - } + public static DecimalIntConverter GetInstance() + { + return _uniqueInstance ??= new DecimalIntConverter(); + } } } diff --git a/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs b/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs index 027309762..692254c37 100644 --- a/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs +++ b/Greenshot/Drawing/Fields/Binding/NotNullValidator.cs @@ -24,7 +24,7 @@ namespace Greenshot.Drawing.Fields.Binding { /// Validates a value not to be null. /// public class NotNullValidator : IBindingValidator { - private static NotNullValidator uniqueInstance; + private static NotNullValidator _uniqueInstance; private NotNullValidator() { } @@ -33,9 +33,9 @@ namespace Greenshot.Drawing.Fields.Binding { return o != null; } - public static NotNullValidator GetInstance() { - if(uniqueInstance == null) uniqueInstance = new NotNullValidator(); - return uniqueInstance; - } + public static NotNullValidator GetInstance() + { + return _uniqueInstance ??= new NotNullValidator(); + } } } diff --git a/Greenshot/Forms/AboutForm.cs b/Greenshot/Forms/AboutForm.cs index f83c219e5..1c7d2ddcc 100644 --- a/Greenshot/Forms/AboutForm.cs +++ b/Greenshot/Forms/AboutForm.cs @@ -330,7 +330,7 @@ namespace Greenshot { return base.ProcessCmdKey(ref msg, keyData); } } catch (Exception ex) { - LOG.Error(string.Format("Error handling key '{0}'", keyData), ex); + LOG.Error($"Error handling key '{keyData}'", ex); } return true; } diff --git a/Greenshot/Forms/LanguageDialog.cs b/Greenshot/Forms/LanguageDialog.cs index 3b597e810..7565285b8 100644 --- a/Greenshot/Forms/LanguageDialog.cs +++ b/Greenshot/Forms/LanguageDialog.cs @@ -30,8 +30,8 @@ namespace Greenshot.Forms { /// public partial class LanguageDialog : Form { private static readonly ILog LOG = LogManager.GetLogger(typeof(LanguageDialog)); - private static LanguageDialog uniqueInstance; - private bool properOkPressed; + private static LanguageDialog _uniqueInstance; + private bool _properOkPressed; private LanguageDialog() { // @@ -44,16 +44,14 @@ namespace Greenshot.Forms { } private void PreventFormClose(object sender, FormClosingEventArgs e) { - if(!properOkPressed) { + if(!_properOkPressed) { e.Cancel = true; } } - public string SelectedLanguage { - get { return comboBoxLanguage.SelectedValue.ToString(); } - } - - protected void FormLoad(object sender, EventArgs e) { + public string SelectedLanguage => comboBoxLanguage.SelectedValue.ToString(); + + protected void FormLoad(object sender, EventArgs e) { // Initialize the Language ComboBox comboBoxLanguage.DisplayMember = "Description"; comboBoxLanguage.ValueMember = "Ietf"; @@ -74,23 +72,21 @@ namespace Greenshot.Forms { if (Language.SupportedLanguages.Count == 1) { comboBoxLanguage.SelectedValue = Language.SupportedLanguages[0].Ietf; Language.CurrentLanguage = SelectedLanguage; - properOkPressed = true; + _properOkPressed = true; Close(); } } private void BtnOKClick(object sender, EventArgs e) { - properOkPressed = true; + _properOkPressed = true; // Fix for Bug #3431100 Language.CurrentLanguage = SelectedLanguage; Close(); } - public static LanguageDialog GetInstance() { - if(uniqueInstance == null) { - uniqueInstance = new LanguageDialog(); - } - return uniqueInstance; - } + public static LanguageDialog GetInstance() + { + return _uniqueInstance ??= new LanguageDialog(); + } } } diff --git a/Greenshot/Helpers/EnvironmentInfo.cs b/Greenshot/Helpers/EnvironmentInfo.cs index af18625bf..a5a4c04c4 100644 --- a/Greenshot/Helpers/EnvironmentInfo.cs +++ b/Greenshot/Helpers/EnvironmentInfo.cs @@ -98,7 +98,7 @@ namespace Greenshot.Helpers { environment.Append(", "); } - environment.Append(string.Format("OS: {0} {1} {2} (x{3}) {4}", OsInfo.Name, OsInfo.Edition, OsInfo.ServicePack, OsInfo.Bits, OsInfo.VersionString)); + environment.Append($"OS: {OsInfo.Name} {OsInfo.Edition} {OsInfo.ServicePack} (x{OsInfo.Bits}) {OsInfo.VersionString}"); if (newline) { environment.AppendLine(); diff --git a/Greenshot/Helpers/PluginHelper.cs b/Greenshot/Helpers/PluginHelper.cs index be2dfdf9a..87bb08d99 100644 --- a/Greenshot/Helpers/PluginHelper.cs +++ b/Greenshot/Helpers/PluginHelper.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -171,8 +172,9 @@ namespace Greenshot.Helpers { if (!Directory.Exists(path)) return pluginFiles; try { - pluginFiles = Directory.GetFiles(path, "*Plugin.dll", SearchOption.AllDirectories); - + pluginFiles = Directory.GetFiles(path, "*Plugin.dll", SearchOption.AllDirectories) + // Skip the GreenshotPlugin.dll itself + .Where(p => CultureInfo.CurrentCulture.CompareInfo.IndexOf(p, "GreenshotPlugin.dll", CompareOptions.IgnoreCase) < 0); } catch (Exception ex) { Log.Error("Error loading plugin: ", ex); } diff --git a/Greenshot/Processors/TitleFixProcessor.cs b/Greenshot/Processors/TitleFixProcessor.cs index e98881ac1..368653ee9 100644 --- a/Greenshot/Processors/TitleFixProcessor.cs +++ b/Greenshot/Processors/TitleFixProcessor.cs @@ -38,53 +38,43 @@ namespace Greenshot.Processors { public TitleFixProcessor() { List corruptKeys = new List(); foreach(string key in config.ActiveTitleFixes) { - if (!config.TitleFixMatcher.ContainsKey(key)) { - LOG.WarnFormat("Key {0} not found, configuration is broken! Disabling this key!"); - corruptKeys.Add(key); - } - } + if (config.TitleFixMatcher.ContainsKey(key)) continue; + + LOG.WarnFormat("Key {0} not found, configuration is broken! Disabling this key!", key); + corruptKeys.Add(key); + } // Fix configuration if needed - if(corruptKeys.Count > 0) { - foreach(string corruptKey in corruptKeys) { - // Removing any reference to the key - config.ActiveTitleFixes.Remove(corruptKey); - config.TitleFixMatcher.Remove(corruptKey); - config.TitleFixReplacer.Remove(corruptKey); - } - config.IsDirty = true; - } - } + if (corruptKeys.Count <= 0) return; + + foreach(string corruptKey in corruptKeys) { + // Removing any reference to the key + config.ActiveTitleFixes.Remove(corruptKey); + config.TitleFixMatcher.Remove(corruptKey); + config.TitleFixReplacer.Remove(corruptKey); + } + config.IsDirty = true; + } - public override string Designation { - get { - return "TitleFix"; - } - } + public override string Designation => "TitleFix"; - public override string Description { - get { - return Designation; - } - } + public override string Description => Designation; - public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) { + public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails) { bool changed = false; string title = captureDetails.Title; if (!string.IsNullOrEmpty(title)) { title = title.Trim(); foreach(string titleIdentifier in config.ActiveTitleFixes) { string regexpString = config.TitleFixMatcher[titleIdentifier]; - string replaceString = config.TitleFixReplacer[titleIdentifier]; - if (replaceString == null) { - replaceString = ""; - } - if (!string.IsNullOrEmpty(regexpString)) { - Regex regex = new Regex(regexpString); - title = regex.Replace(title, replaceString); - changed = true; - } - } + string replaceString = config.TitleFixReplacer[titleIdentifier] ?? ""; + + if (string.IsNullOrEmpty(regexpString)) continue; + + var regex = new Regex(regexpString); + title = regex.Replace(title, replaceString); + changed = true; + } } captureDetails.Title = title; return changed; diff --git a/GreenshotConfluencePlugin/ConfluencePlugin.cs b/GreenshotConfluencePlugin/ConfluencePlugin.cs index 40f4248b6..8dac45b97 100644 --- a/GreenshotConfluencePlugin/ConfluencePlugin.cs +++ b/GreenshotConfluencePlugin/ConfluencePlugin.cs @@ -31,6 +31,7 @@ namespace GreenshotConfluencePlugin { /// /// This is the ConfluencePlugin base code /// + [Plugin("Confluence", true)] public class ConfluencePlugin : IGreenshotPlugin { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ConfluencePlugin)); private static ConfluenceConnector _confluenceConnector; diff --git a/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs b/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs index cb6db1b84..76c82b2df 100644 --- a/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs +++ b/GreenshotConfluencePlugin/Forms/ConfluenceUpload.xaml.cs @@ -45,22 +45,12 @@ namespace GreenshotConfluencePlugin { private Page _searchPage; public Page SearchPage { - get { - if (_searchPage == null) { - _searchPage = new ConfluenceSearch(this); - } - return _searchPage; - } + get { return _searchPage ??= new ConfluenceSearch(this); } } private Page _browsePage; public Page BrowsePage { - get { - if (_browsePage == null) { - _browsePage = new ConfluenceTreePicker(this); - } - return _browsePage; - } + get { return _browsePage ??= new ConfluenceTreePicker(this); } } private Confluence.Page _selectedPage; @@ -70,11 +60,7 @@ namespace GreenshotConfluencePlugin { } set { _selectedPage = value; - if (_selectedPage != null) { - Upload.IsEnabled = true; - } else { - Upload.IsEnabled = false; - } + Upload.IsEnabled = _selectedPage != null; IsOpenPageSelected = false; } } diff --git a/GreenshotConfluencePlugin/Support/TranslationManager.cs b/GreenshotConfluencePlugin/Support/TranslationManager.cs index bf315a5d5..d11d36cd5 100644 --- a/GreenshotConfluencePlugin/Support/TranslationManager.cs +++ b/GreenshotConfluencePlugin/Support/TranslationManager.cs @@ -25,7 +25,7 @@ namespace TranslationByMarkupExtension { } }*/ - public static TranslationManager Instance => _translationManager ?? (_translationManager = new TranslationManager()); + public static TranslationManager Instance => _translationManager ??= new TranslationManager(); public ITranslationProvider TranslationProvider { get; set; } diff --git a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs index 0188db3b8..3f44bca79 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandConfiguration.cs @@ -18,13 +18,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; using System.IO; using Greenshot.IniFile; using GreenshotPlugin.Core; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// Description of FlickrConfiguration. /// diff --git a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs index 1ad2060ea..01759d35f 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandDestination.cs @@ -18,18 +18,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; +using System.ComponentModel; using System.Diagnostics; using System.Drawing; +using System.Text.RegularExpressions; using System.Threading; using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Core; -using System.ComponentModel; -using System.Text.RegularExpressions; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// Description of OCRDestination. /// @@ -63,12 +64,9 @@ namespace ExternalCommand { config.RunInbackground.Add(_presetCommand, true); } bool runInBackground = config.RunInbackground[_presetCommand]; - string fullPath = captureDetails.Filename; - if (fullPath == null) { - fullPath = ImageOutput.SaveNamedTmpFile(surface, captureDetails, outputSettings); - } + string fullPath = captureDetails.Filename ?? ImageOutput.SaveNamedTmpFile(surface, captureDetails, outputSettings); - string output; + string output; string error; if (runInBackground) { Thread commandThread = new Thread(delegate() diff --git a/GreenshotExternalCommandPlugin/ExternalCommandForm.cs b/GreenshotExternalCommandPlugin/ExternalCommandForm.cs index e5866441d..dd42fbbe2 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandForm.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandForm.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using GreenshotPlugin.Controls; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// This class is needed for design-time resolving of the language files /// diff --git a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs index 1ecb2ef43..bf7b74377 100644 --- a/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs +++ b/GreenshotExternalCommandPlugin/ExternalCommandPlugin.cs @@ -19,16 +19,16 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Plugin; -using GreenshotPlugin.Core; using System; using System.Collections.Generic; using System.ComponentModel; using System.IO; using System.Windows.Forms; +using Greenshot.IniFile; +using Greenshot.Plugin; +using GreenshotPlugin.Core; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// An Plugin to run commands after an image was written /// diff --git a/GreenshotExternalCommandPlugin/IconCache.cs b/GreenshotExternalCommandPlugin/IconCache.cs index 029c61a4c..4bf4245a2 100644 --- a/GreenshotExternalCommandPlugin/IconCache.cs +++ b/GreenshotExternalCommandPlugin/IconCache.cs @@ -25,7 +25,7 @@ using System.IO; using Greenshot.IniFile; using GreenshotPlugin.Core; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { public static class IconCache { private static readonly ExternalCommandConfiguration config = IniConfig.GetIniSection(); private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(IconCache)); diff --git a/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs b/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs index c5c42dcdc..17df962df 100644 --- a/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs +++ b/GreenshotExternalCommandPlugin/SettingsForm.Designer.cs @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { partial class SettingsForm { /// /// Designer variable used to keep track of non-visual components. diff --git a/GreenshotExternalCommandPlugin/SettingsForm.cs b/GreenshotExternalCommandPlugin/SettingsForm.cs index 9fa5313f4..fa650832a 100644 --- a/GreenshotExternalCommandPlugin/SettingsForm.cs +++ b/GreenshotExternalCommandPlugin/SettingsForm.cs @@ -19,12 +19,12 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using System; using System.Drawing; using System.Windows.Forms; +using Greenshot.IniFile; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// Description of SettingsForm. /// diff --git a/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs b/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs index 6e0d7dbea..200bd7a30 100644 --- a/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs +++ b/GreenshotExternalCommandPlugin/SettingsFormDetail.Designer.cs @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { partial class SettingsFormDetail { /// /// Designer variable used to keep track of non-visual components. diff --git a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs index 00e893d25..9aee37edf 100644 --- a/GreenshotExternalCommandPlugin/SettingsFormDetail.cs +++ b/GreenshotExternalCommandPlugin/SettingsFormDetail.cs @@ -19,14 +19,14 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; using System; using System.Drawing; using System.IO; using System.Windows.Forms; +using Greenshot.IniFile; using GreenshotPlugin.Core; -namespace ExternalCommand { +namespace GreenshotExternalCommandPlugin { /// /// Description of SettingsFormDetail. /// diff --git a/GreenshotFlickrPlugin/FlickrPlugin.cs b/GreenshotFlickrPlugin/FlickrPlugin.cs index 1a3676332..98a3cd020 100644 --- a/GreenshotFlickrPlugin/FlickrPlugin.cs +++ b/GreenshotFlickrPlugin/FlickrPlugin.cs @@ -35,6 +35,7 @@ namespace GreenshotFlickrPlugin /// /// This is the Flickr base code /// + [Plugin("Flickr", true)] public class FlickrPlugin : IGreenshotPlugin { private static readonly ILog Log = LogManager.GetLogger(typeof(FlickrPlugin)); private static FlickrConfiguration _config; diff --git a/GreenshotJiraPlugin/JiraPlugin.cs b/GreenshotJiraPlugin/JiraPlugin.cs index 7127e6cbe..726454ad4 100644 --- a/GreenshotJiraPlugin/JiraPlugin.cs +++ b/GreenshotJiraPlugin/JiraPlugin.cs @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -using System.Collections.Generic; + using System.Windows.Forms; using Greenshot.IniFile; using Greenshot.Plugin; diff --git a/GreenshotOCRPlugin/GreenshotOCRPlugin.csproj b/GreenshotOCRPlugin/GreenshotOCRPlugin.csproj index 86e73629f..42e03e628 100644 --- a/GreenshotOCRPlugin/GreenshotOCRPlugin.csproj +++ b/GreenshotOCRPlugin/GreenshotOCRPlugin.csproj @@ -1,7 +1,7 @@  - GreenshotOCR + GreenshotOCRPlugin GreenshotOCRPlugin diff --git a/GreenshotOCRPlugin/ModiLanguage.cs b/GreenshotOCRPlugin/ModiLanguage.cs index b707d3f69..ae531b6ab 100644 --- a/GreenshotOCRPlugin/ModiLanguage.cs +++ b/GreenshotOCRPlugin/ModiLanguage.cs @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace GreenshotOCR +namespace GreenshotOCRPlugin { /// /// Needed for the drop down, available languages for OCR diff --git a/GreenshotOCRPlugin/OCRConfiguration.cs b/GreenshotOCRPlugin/OCRConfiguration.cs index b159e061a..7c8e1fd55 100644 --- a/GreenshotOCRPlugin/OCRConfiguration.cs +++ b/GreenshotOCRPlugin/OCRConfiguration.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using Greenshot.IniFile; -namespace GreenshotOCR { +namespace GreenshotOCRPlugin { /// /// Description of CoreConfiguration. /// diff --git a/GreenshotOCRPlugin/OCRDestination.cs b/GreenshotOCRPlugin/OCRDestination.cs index 83ee851a1..1f59d0c15 100644 --- a/GreenshotOCRPlugin/OCRDestination.cs +++ b/GreenshotOCRPlugin/OCRDestination.cs @@ -18,12 +18,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System.Drawing; using System.IO; using Greenshot.Plugin; using GreenshotPlugin.Core; -namespace GreenshotOCR { +namespace GreenshotOCRPlugin { /// /// Description of OCRDestination. /// diff --git a/GreenshotOCRPlugin/OCRForm.cs b/GreenshotOCRPlugin/OCRForm.cs index d6022449f..299bd990a 100644 --- a/GreenshotOCRPlugin/OCRForm.cs +++ b/GreenshotOCRPlugin/OCRForm.cs @@ -21,7 +21,7 @@ using GreenshotPlugin.Controls; -namespace GreenshotOCR { +namespace GreenshotOCRPlugin { /// /// This class is needed for design-time resolving of the language files /// diff --git a/GreenshotOCRPlugin/OCRPlugin.cs b/GreenshotOCRPlugin/OCRPlugin.cs index 107be1da7..3e3dbd76e 100644 --- a/GreenshotOCRPlugin/OCRPlugin.cs +++ b/GreenshotOCRPlugin/OCRPlugin.cs @@ -18,6 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Diagnostics; using System.IO; @@ -29,7 +30,7 @@ using GreenshotPlugin.Effects; //using Microsoft.Win32; -namespace GreenshotOCR { +namespace GreenshotOCRPlugin { /// /// OCR Plugin Greenshot /// @@ -45,14 +46,13 @@ namespace GreenshotOCR { GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) { - if (disposing) { - if (_ocrMenuItem != null) { - _ocrMenuItem.Dispose(); - _ocrMenuItem = null; - } - } - } + protected void Dispose(bool disposing) + { + if (!disposing) return; + if (_ocrMenuItem == null) return; + _ocrMenuItem.Dispose(); + _ocrMenuItem = null; + } /// /// Implementation of the IGreenshotPlugin.Initialize diff --git a/GreenshotOCRPlugin/SettingsForm.Designer.cs b/GreenshotOCRPlugin/SettingsForm.Designer.cs index 566b29a82..5b0dfe877 100644 --- a/GreenshotOCRPlugin/SettingsForm.Designer.cs +++ b/GreenshotOCRPlugin/SettingsForm.Designer.cs @@ -18,7 +18,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -namespace GreenshotOCR +namespace GreenshotOCRPlugin { partial class SettingsForm { diff --git a/GreenshotOCRPlugin/SettingsForm.cs b/GreenshotOCRPlugin/SettingsForm.cs index 7d0719124..b2c88629d 100644 --- a/GreenshotOCRPlugin/SettingsForm.cs +++ b/GreenshotOCRPlugin/SettingsForm.cs @@ -18,9 +18,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; -namespace GreenshotOCR { +namespace GreenshotOCRPlugin { /// /// Description of SettingsForm. /// diff --git a/GreenshotOfficePlugin/Destinations/ExcelDestination.cs b/GreenshotOfficePlugin/Destinations/ExcelDestination.cs index 98ee5a218..17f9be7ae 100644 --- a/GreenshotOfficePlugin/Destinations/ExcelDestination.cs +++ b/GreenshotOfficePlugin/Destinations/ExcelDestination.cs @@ -22,12 +22,12 @@ using System.Collections.Generic; using System.Drawing; using System.IO; -using GreenshotPlugin.Core; -using Greenshot.Plugin; -using Greenshot.Interop.Office; using System.Text.RegularExpressions; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeExport; +using GreenshotPlugin.Core; -namespace GreenshotOfficePlugin { +namespace GreenshotOfficePlugin.Destinations { /// /// Description of PowerpointDestination. /// diff --git a/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs b/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs index 23c7dd171..0274d6da3 100644 --- a/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs +++ b/GreenshotOfficePlugin/Destinations/OneNoteDestination.cs @@ -19,15 +19,16 @@ * along with this program. If not, see . */ -using Greenshot.Interop.Office; -using Greenshot.Plugin; -using GreenshotPlugin.Core; using System; using System.Collections.Generic; using System.Drawing; using System.IO; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeExport; +using GreenshotOfficePlugin.OfficeInterop.OneNote; +using GreenshotPlugin.Core; -namespace GreenshotOfficePlugin { +namespace GreenshotOfficePlugin.Destinations { public class OneNoteDestination : AbstractDestination { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WordDestination)); private const int ICON_APPLICATION = 0; diff --git a/GreenshotOfficePlugin/Destinations/OutlookDestination.cs b/GreenshotOfficePlugin/Destinations/OutlookDestination.cs index 443a7ac89..7ffec12a7 100644 --- a/GreenshotOfficePlugin/Destinations/OutlookDestination.cs +++ b/GreenshotOfficePlugin/Destinations/OutlookDestination.cs @@ -19,17 +19,18 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using Greenshot.Interop.Office; -using Greenshot.Plugin; -using GreenshotPlugin.Core; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text.RegularExpressions; using System.Windows.Forms; +using Greenshot.IniFile; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeExport; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotPlugin.Core; -namespace GreenshotOfficePlugin { +namespace GreenshotOfficePlugin.Destinations { /// /// Description of OutlookDestination. /// diff --git a/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs b/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs index 6d3e0b3e6..ea103a97f 100644 --- a/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs +++ b/GreenshotOfficePlugin/Destinations/PowerpointDestination.cs @@ -22,12 +22,12 @@ using System.Collections.Generic; using System.Drawing; using System.IO; -using GreenshotPlugin.Core; -using Greenshot.Plugin; -using Greenshot.Interop.Office; using System.Text.RegularExpressions; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeExport; +using GreenshotPlugin.Core; -namespace GreenshotOfficePlugin { +namespace GreenshotOfficePlugin.Destinations { /// /// Description of PowerpointDestination. /// diff --git a/GreenshotOfficePlugin/Destinations/WordDestination.cs b/GreenshotOfficePlugin/Destinations/WordDestination.cs index 4065e7f7a..260494928 100644 --- a/GreenshotOfficePlugin/Destinations/WordDestination.cs +++ b/GreenshotOfficePlugin/Destinations/WordDestination.cs @@ -19,16 +19,16 @@ * along with this program. If not, see . */ -using Greenshot.Interop.Office; -using Greenshot.Plugin; -using GreenshotPlugin.Core; using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Text.RegularExpressions; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeExport; +using GreenshotPlugin.Core; -namespace GreenshotOfficePlugin { +namespace GreenshotOfficePlugin.Destinations { /// /// Description of EmailDestination. /// diff --git a/GreenshotOfficePlugin/OfficeConfiguration.cs b/GreenshotOfficePlugin/OfficeConfiguration.cs index d308d1a4e..cee2f5ffd 100644 --- a/GreenshotOfficePlugin/OfficeConfiguration.cs +++ b/GreenshotOfficePlugin/OfficeConfiguration.cs @@ -19,7 +19,8 @@ * along with this program. If not, see . */ using Greenshot.IniFile; -using Greenshot.Interop.Office; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Powerpoint; namespace GreenshotOfficePlugin { diff --git a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs index f90544a44..67d85796d 100644 --- a/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/ExcelExporter.cs @@ -18,13 +18,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; -using System.Reflection; using System.Drawing; +using System.Reflection; +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop; +using GreenshotOfficePlugin.OfficeInterop.Excel; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Powerpoint; using GreenshotPlugin.Core; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeExport { public class ExcelExporter { private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(ExcelExporter)); private static Version _excelVersion; @@ -89,22 +95,17 @@ namespace Greenshot.Interop.Office { /// private static void InsertIntoExistingWorkbook(IWorkbook workbook, string tmpFile, Size imageSize) { IWorksheet workSheet = workbook.ActiveSheet; - if (workSheet == null) { - return; - } - using IShapes shapes = workSheet.Shapes; - if (shapes != null) - { - using IShape shape = shapes.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, imageSize.Width, imageSize.Height); - if (shape != null) { - shape.Top = 40; - shape.Left = 40; - shape.LockAspectRatio = MsoTriState.msoTrue; - shape.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft); - shape.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft); - } - } + using IShapes shapes = workSheet?.Shapes; + + using IShape shape = shapes?.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, 0, 0, imageSize.Width, imageSize.Height); + if (shape == null) return; + + shape.Top = 40; + shape.Left = 40; + shape.LockAspectRatio = MsoTriState.msoTrue; + shape.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft); + shape.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromTopLeft); } /// diff --git a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs index 1a9c71de1..71ef1d85f 100644 --- a/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/OneNoteExporter.cs @@ -19,15 +19,17 @@ * along with this program. If not, see . */ -using System.Runtime.InteropServices; -using Greenshot.Plugin; -using GreenshotPlugin.Core; using System; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; using System.Xml; +using Greenshot.Interop; +using Greenshot.Plugin; +using GreenshotOfficePlugin.OfficeInterop.OneNote; +using GreenshotPlugin.Core; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeExport { public class OneNoteExporter { private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(OneNoteExporter)); diff --git a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs index cc5b3a93c..fb9670d3c 100644 --- a/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/OutlookEmailExporter.cs @@ -18,17 +18,20 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; -using System.Text; using System.IO; - -using Microsoft.Win32; -using Greenshot.Interop.IE; -using GreenshotOfficePlugin; +using System.Text; using Greenshot.IniFile; +using Greenshot.Interop; +using Greenshot.Interop.IE; +using GreenshotOfficePlugin.OfficeInterop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Word; +using Microsoft.Win32; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeExport { /// /// Outlook exporter has all the functionality to export to outlook /// diff --git a/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs b/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs index 03d792c76..8c3270dce 100644 --- a/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/PowerpointExporter.cs @@ -19,13 +19,16 @@ * along with this program. If not, see . */ -using Greenshot.IniFile; -using GreenshotOfficePlugin; using System; using System.Collections.Generic; using System.Drawing; +using Greenshot.IniFile; +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Powerpoint; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeExport { public class PowerpointExporter { private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PowerpointExporter)); private static Version _powerpointVersion; diff --git a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs index 9cb731a14..563b6cd4a 100644 --- a/GreenshotOfficePlugin/OfficeExport/WordExporter.cs +++ b/GreenshotOfficePlugin/OfficeExport/WordExporter.cs @@ -18,13 +18,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Collections.Generic; -using GreenshotOfficePlugin; using Greenshot.IniFile; +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; +using GreenshotOfficePlugin.OfficeInterop.Word; using GreenshotPlugin.Core; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeExport { public class WordExporter { private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(WordExporter)); private static Version _wordVersion; diff --git a/GreenshotOfficePlugin/OfficeInterop/ExcelInterop.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs similarity index 50% rename from GreenshotOfficePlugin/OfficeInterop/ExcelInterop.cs rename to GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs index f456cda16..4f3509f80 100644 --- a/GreenshotOfficePlugin/OfficeInterop/ExcelInterop.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IExcelApplication.cs @@ -19,21 +19,28 @@ * along with this program. If not, see . */ -namespace Greenshot.Interop.Office { - // See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.application.aspx +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Excel { + /// + /// See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.application.aspx + /// [ComProgId("Excel.Application")] public interface IExcelApplication : ICommon { IWorkbook ActiveWorkbook { get; } + //ISelection Selection {get;} IWorkbooks Workbooks { get; } + bool Visible { get; set; } + string Version { get; } @@ -46,54 +53,4 @@ namespace Greenshot.Interop.Office { get; } } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.aspx - public interface IWorkbooks : ICommon, ICollection { - IWorkbook Add(object template); - // Use index + 1!! - IWorkbook this[object index] { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbook.aspx - public interface IWorkbook : ICommon { - IWorksheet ActiveSheet { - get; - } - string Name { - get; - } - void Activate(); - IWorksheets Worksheets { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._worksheet_members.aspx - public interface IWorksheet : ICommon { - IPictures Pictures { - get; - } - IShapes Shapes { - get; - } - string Name { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.iworksheets_members.aspx - public interface IWorksheets : ICollection { - // Use index + 1!! - IWorksheet this[object index] { - get; - } - } - - public interface IPictures : ICollection { - // Use index + 1!! - //IPicture this[object Index] { get; } - void Insert(string file); - } } diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IPictures.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IPictures.cs new file mode 100644 index 000000000..d64cac671 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IPictures.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Excel +{ + public interface IPictures : ICollection { + // Use index + 1!! + //IPicture this[object Index] { get; } + void Insert(string file); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs new file mode 100644 index 000000000..fce3f4f12 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbook.cs @@ -0,0 +1,20 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Excel +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbook.aspx + /// + public interface IWorkbook : ICommon { + IWorksheet ActiveSheet { + get; + } + string Name { + get; + } + void Activate(); + IWorksheets Worksheets { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs new file mode 100644 index 000000000..4b7e9750c --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorkbooks.cs @@ -0,0 +1,15 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Excel +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.aspx + /// + public interface IWorkbooks : ICommon, ICollection { + IWorkbook Add(object template); + // Use index + 1!! + IWorkbook this[object index] { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs new file mode 100644 index 000000000..d4a214a63 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheet.cs @@ -0,0 +1,20 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Powerpoint; + +namespace GreenshotOfficePlugin.OfficeInterop.Excel +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._worksheet_members.aspx + /// + public interface IWorksheet : ICommon { + IPictures Pictures { + get; + } + IShapes Shapes { + get; + } + string Name { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheets.cs b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheets.cs new file mode 100644 index 000000000..f8aac3bed --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Excel/IWorksheets.cs @@ -0,0 +1,12 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Excel +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.iworksheets_members.aspx + /// + public interface IWorksheets : ICollection { + // Use index + 1!! + IWorksheet this[object index] { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OfficeInterop.cs b/GreenshotOfficePlugin/OfficeInterop/ICollection.cs similarity index 81% rename from GreenshotOfficePlugin/OfficeInterop/OfficeInterop.cs rename to GreenshotOfficePlugin/OfficeInterop/ICollection.cs index adba5fd12..461076be5 100644 --- a/GreenshotOfficePlugin/OfficeInterop/OfficeInterop.cs +++ b/GreenshotOfficePlugin/OfficeInterop/ICollection.cs @@ -18,20 +18,12 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System.Collections; +using Greenshot.Interop; -namespace Greenshot.Interop.Office { - public enum OfficeVersion : int { - OFFICE_97 = 8, - OFFICE_2000 = 9, - OFFICE_2002 = 10, - OFFICE_2003 = 11, - OFFICE_2007 = 12, - OFFICE_2010 = 14, - OFFICE_2013 = 15 - } - - /// +namespace GreenshotOfficePlugin.OfficeInterop { + /// /// If the "type" this[object index] { get; } is implemented, use index + 1!!! (starts at 1) /// public interface ICollection : ICommon, IEnumerable { diff --git a/GreenshotOfficePlugin/OfficeInterop/MsoScaleFrom.cs b/GreenshotOfficePlugin/OfficeInterop/MsoScaleFrom.cs new file mode 100644 index 000000000..ad8a534a5 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/MsoScaleFrom.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop +{ + public enum MsoScaleFrom { + msoScaleFromTopLeft = 0, + msoScaleFromMiddle = 1, + msoScaleFromBottomRight = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/MsoTriState.cs b/GreenshotOfficePlugin/OfficeInterop/MsoTriState.cs new file mode 100644 index 000000000..f13e86050 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/MsoTriState.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop +{ + public enum MsoTriState { + msoTrue = -1, + msoFalse = 0, + msoCTrue = 1, + msoTriStateToggle = -3, + msoTriStateMixed = -2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OfficeVersion.cs b/GreenshotOfficePlugin/OfficeInterop/OfficeVersion.cs new file mode 100644 index 000000000..0d8e846c8 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OfficeVersion.cs @@ -0,0 +1,12 @@ +namespace GreenshotOfficePlugin.OfficeInterop +{ + public enum OfficeVersion : int { + OFFICE_97 = 8, + OFFICE_2000 = 9, + OFFICE_2002 = 10, + OFFICE_2003 = 11, + OFFICE_2007 = 12, + OFFICE_2010 = 14, + OFFICE_2013 = 15 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/HierarchyScope.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/HierarchyScope.cs new file mode 100644 index 000000000..da9ceda0e --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/HierarchyScope.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public enum HierarchyScope { + hsSelf = 0, // Gets just the start node specified and no descendants. + hsChildren = 1, //Gets the immediate child nodes of the start node, and no descendants in higher or lower subsection groups. + hsNotebooks = 2, // Gets all notebooks below the start node, or root. + hsSections = 3, //Gets all sections below the start node, including sections in section groups and subsection groups. + hsPages = 4 //Gets all pages below the start node, including all pages in section groups and subsection groups. + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs new file mode 100644 index 000000000..f18315bd0 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/IOneNoteApplication.cs @@ -0,0 +1,19 @@ +using System; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + [ComProgId("OneNote.Application")] + public interface IOneNoteApplication : ICommon { + /// + /// Make sure that the out variables are filled with a string, e.g. "", otherwise a type error occurs. + /// For more info on the methods: http://msdn.microsoft.com/en-us/library/gg649853.aspx + /// + void GetHierarchy(string startNode, HierarchyScope scope, out string notebookXml, XMLSchema schema); + void GetSpecialLocation(SpecialLocation specialLocation, out string specialLocationPath); + void UpdatePageContent(string pageChangesXml, DateTime dateExpectedLastModified, XMLSchema schema, bool force); + void GetPageContent(string pageId, out string pageXml, PageInfo pageInfoToExport, XMLSchema schema); + void NavigateTo(string hierarchyObjectID, string objectId, bool newWindow); + void CreateNewPage(string sectionID, out string pageID, NewPageStyle newPageStyle); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/NewPageStyle.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/NewPageStyle.cs new file mode 100644 index 000000000..a5f14ed5c --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/NewPageStyle.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public enum NewPageStyle { + npsDefault = 0, + npsBlankPageWithTitle = 1, + npsBlankPageNoTitle = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteNotebook.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteNotebook.cs new file mode 100644 index 000000000..daa2840e6 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteNotebook.cs @@ -0,0 +1,7 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public class OneNoteNotebook { + public string Name { get; set; } + public string ID { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNotePage.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNotePage.cs new file mode 100644 index 000000000..198c1b237 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNotePage.cs @@ -0,0 +1,43 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +namespace GreenshotOfficePlugin.OfficeInterop.OneNote { + // More details about OneNote: http://msdn.microsoft.com/en-us/magazine/ff796230.aspx + + // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx + + public class OneNotePage { + public OneNoteSection Parent { get; set; } + public string Name { get; set; } + public string ID { get; set; } + public bool IsCurrentlyViewed { get; set; } + public string DisplayName { + get { + OneNoteNotebook notebook = Parent.Parent; + if(string.IsNullOrEmpty(notebook.Name)) { + return $"{Parent.Name} / {Name}"; + } + + return $"{Parent.Parent.Name} / {Parent.Name} / {Name}"; + } + } + } +} diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteSection.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteSection.cs new file mode 100644 index 000000000..c7af1a908 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/OneNoteSection.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public class OneNoteSection { + public OneNoteNotebook Parent { get; set; } + public string Name { get; set; } + public string ID { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/PageInfo.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/PageInfo.cs new file mode 100644 index 000000000..b4cbc5aba --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/PageInfo.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public enum PageInfo { + piBasic = 0, // Returns only basic page content, without selection markup and binary data objects. This is the standard value to pass. + piBinaryData = 1, // Returns page content with no selection markup, but with all binary data. + piSelection = 2, // Returns page content with selection markup, but no binary data. + piBinaryDataSelection = 3, // Returns page content with selection markup and all binary data. + piAll = 3 // Returns all page content. + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/SpecialLocation.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/SpecialLocation.cs new file mode 100644 index 000000000..38afca532 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/SpecialLocation.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public enum SpecialLocation : int { + slBackupFolder = 0, + slUnfiledNotesSection = 1, + slDefaultNotebookFolder = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNote/XMLSchema.cs b/GreenshotOfficePlugin/OfficeInterop/OneNote/XMLSchema.cs new file mode 100644 index 000000000..bce52c20f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/OneNote/XMLSchema.cs @@ -0,0 +1,8 @@ +namespace GreenshotOfficePlugin.OfficeInterop.OneNote +{ + public enum XMLSchema { + xs2007 = 0, + xs2010 = 1, + xsCurrent= xs2010 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OneNoteInterop.cs b/GreenshotOfficePlugin/OfficeInterop/OneNoteInterop.cs deleted file mode 100644 index f1322788f..000000000 --- a/GreenshotOfficePlugin/OfficeInterop/OneNoteInterop.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -using System; - -namespace Greenshot.Interop.Office { - // More details about OneNote: http://msdn.microsoft.com/en-us/magazine/ff796230.aspx - - // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx - [ComProgId("OneNote.Application")] - public interface IOneNoteApplication : ICommon { - /// - /// Make sure that the out variables are filled with a string, e.g. "", otherwise a type error occurs. - /// For more info on the methods: http://msdn.microsoft.com/en-us/library/gg649853.aspx - /// - void GetHierarchy(string startNode, HierarchyScope scope, out string notebookXml, XMLSchema schema); - void GetSpecialLocation(SpecialLocation specialLocation, out string specialLocationPath); - void UpdatePageContent(string pageChangesXml, DateTime dateExpectedLastModified, XMLSchema schema, bool force); - void GetPageContent(string pageId, out string pageXml, PageInfo pageInfoToExport, XMLSchema schema); - void NavigateTo(string hierarchyObjectID, string objectId, bool newWindow); - void CreateNewPage(string sectionID, out string pageID, NewPageStyle newPageStyle); - } - - public enum PageInfo { - piBasic = 0, // Returns only basic page content, without selection markup and binary data objects. This is the standard value to pass. - piBinaryData = 1, // Returns page content with no selection markup, but with all binary data. - piSelection = 2, // Returns page content with selection markup, but no binary data. - piBinaryDataSelection = 3, // Returns page content with selection markup and all binary data. - piAll = 3 // Returns all page content. - } - - public enum HierarchyScope { - hsSelf = 0, // Gets just the start node specified and no descendants. - hsChildren = 1, //Gets the immediate child nodes of the start node, and no descendants in higher or lower subsection groups. - hsNotebooks = 2, // Gets all notebooks below the start node, or root. - hsSections = 3, //Gets all sections below the start node, including sections in section groups and subsection groups. - hsPages = 4 //Gets all pages below the start node, including all pages in section groups and subsection groups. - } - - public enum XMLSchema { - xs2007 = 0, - xs2010 = 1, - xsCurrent= xs2010 - } - - public enum SpecialLocation : int { - slBackupFolder = 0, - slUnfiledNotesSection = 1, - slDefaultNotebookFolder = 2 - } - - public enum NewPageStyle { - npsDefault = 0, - npsBlankPageWithTitle = 1, - npsBlankPageNoTitle = 2 - } - - public class OneNotePage { - public OneNoteSection Parent { get; set; } - public string Name { get; set; } - public string ID { get; set; } - public bool IsCurrentlyViewed { get; set; } - public string DisplayName { - get { - OneNoteNotebook notebook = Parent.Parent; - if(string.IsNullOrEmpty(notebook.Name)) { - return string.Format("{0} / {1}", Parent.Name, Name); - } else { - return string.Format("{0} / {1} / {2}", Parent.Parent.Name, Parent.Name, Name); - } - } - } - } - - public class OneNoteSection { - public OneNoteNotebook Parent { get; set; } - public string Name { get; set; } - public string ID { get; set; } - } - - public class OneNoteNotebook { - public string Name { get; set; } - public string ID { get; set; } - } -} diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs new file mode 100644 index 000000000..6a6c42638 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/AppointmentItem.cs @@ -0,0 +1,31 @@ +using System; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/ff869026.aspx + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.appointmentitem.aspx + /// + public interface AppointmentItem : IItem, ICommon { + string Organizer { + get; + set; + } + string SendUsingAccount { + get; + } + string Categories { + get; + } + DateTime Start { + get; + } + DateTime End { + get; + } + OlReoccurenceState RecurrenceState { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/EmailFormat.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/EmailFormat.cs new file mode 100644 index 000000000..a105a0dd9 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/EmailFormat.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Specifies which EmailFormat the email needs to use + /// + public enum EmailFormat { + Text, + HTML + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs new file mode 100644 index 000000000..2dde67270 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachment.cs @@ -0,0 +1,27 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.attachment_members.aspx + /// + public interface IAttachment : ICommon { + string DisplayName { + get; + set; + } + string FileName { + get; + } + OlAttachmentType Type { + get; + } + IPropertyAccessor PropertyAccessor { + get; + } + object MAPIOBJECT { + get; + } + void SaveAsFile(string path); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachments.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachments.cs new file mode 100644 index 000000000..64df07e5a --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IAttachments.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public interface IAttachments : ICollection { + IAttachment Add(object source, object type, object position, object displayName); + // Use index+1!!!! + IAttachment this[object index] { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs new file mode 100644 index 000000000..e2c07c5ed --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/ICommonExplorer.cs @@ -0,0 +1,34 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Is a joined interface of the Explorer an Inspector + /// + public interface ICommonExplorer : ICommon { + void Activate(); + string Caption { + get; + } + int Height { + get; + set; + } + int Left { + get; + set; + } + int Top { + get; + set; + } + int Width { + get; + set; + } + OlWindowState WindowState { + get; + set; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs new file mode 100644 index 000000000..3bf14b83a --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IContactItem.cs @@ -0,0 +1,24 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.contactitem.aspx + /// + public interface IContactItem : IItem, ICommon { + bool HasPicture { + get; + } + void SaveBusinessCardImage(string path); + void AddPicture(string path); + void RemovePicture(); + string FirstName { + get; + set; + } + string LastName { + get; + set; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorer.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorer.cs new file mode 100644 index 000000000..001f0fca0 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorer.cs @@ -0,0 +1,18 @@ +using GreenshotOfficePlugin.OfficeInterop.Word; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Since Outlook 2010, but since 2013 one can edit inside an explorer + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.explorer_members(v=office.15).aspx + /// + /// + public interface IExplorer : ICommonExplorer { + IItem ActiveInlineResponse { + get; + } + IWordDocument ActiveInlineResponseWordEditor { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs new file mode 100644 index 000000000..51d6ef802 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IExplorers.cs @@ -0,0 +1,16 @@ +using System.Collections; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Since Outlook 2010, but since 2013 one can edit inside an explorer + /// See: http://msdn.microsoft.com/en-us/library/office/ff867227(v=office.15).aspx + /// + public interface IExplorers : ICommon, ICollection, IEnumerable { + // Use index + 1!! + IExplorer this[object Index] { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs new file mode 100644 index 000000000..f457cf96d --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IFolder.cs @@ -0,0 +1,13 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/bb176362%28v=office.12%29.aspx + /// + public interface IFolder : ICommon { + IItems Items { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspector.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspector.cs new file mode 100644 index 000000000..211152fa9 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspector.cs @@ -0,0 +1,32 @@ +using GreenshotOfficePlugin.OfficeInterop.Word; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.inspector_members.aspx + /// + public interface IInspector : ICommonExplorer { + IItem CurrentItem { + get; + } + OlEditorType EditorType { + get; + } + object ModifiedFormPages { + get; + } + void Close(OlInspectorClose SaveMode); + void Display(object Modal); + void HideFormPage(string PageName); + bool IsWordMail(); + void SetCurrentFormPage(string PageName); + void ShowFormPage(string PageName); + object HTMLEditor { + get; + } + IWordDocument WordEditor { + get; + } + void SetControlItemProperty(object Control, string PropertyName); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs new file mode 100644 index 000000000..c958c9b5f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IInspectors.cs @@ -0,0 +1,15 @@ +using System.Collections; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._application.inspectors.aspx + /// + public interface IInspectors : ICommon, ICollection, IEnumerable { + // Use index + 1!! + IInspector this[object Index] { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs new file mode 100644 index 000000000..25c340e3f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItem.cs @@ -0,0 +1,70 @@ +using System; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Common attributes of all the Items (MailItem, AppointmentItem) + /// See: http://msdn.microsoft.com/en-us/library/ff861252.aspx + /// + public interface IItem : ICommon { + IAttachments Attachments { + get; + } + string Body { + get; + set; + } + OlObjectClass Class { + get; + } + DateTime CreationTime { + get; + } + string EntryID { + get; + } + DateTime LastModificationTime { + get; + } + string MessageClass { + get; + set; + } + bool NoAging { + get; + set; + } + int OutlookInternalVersion { + get; + } + string OutlookVersion { + get; + } + bool Saved { + get; + } + OlSensitivity Sensitivity { + get; + set; + } + int Size { + get; + } + string Subject { + get; + set; + } + bool UnRead { + get; + set; + } + object Copy(); + void Display(bool Modal); + void Save(); + IPropertyAccessor PropertyAccessor { + get; + } + IInspector GetInspector(); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IItems.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItems.cs new file mode 100644 index 000000000..8a6214cd6 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IItems.cs @@ -0,0 +1,28 @@ +using System.Collections; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/bb208387%28v=office.12%29.aspx + /// + public interface IItems : ICollection, IEnumerable { + IItem this[object index] { + get; + } + IItem GetFirst(); + IItem GetNext(); + IItem GetLast(); + IItem GetPrevious(); + + bool IncludeRecurrences { + get; + set; + } + + IItems Restrict(string filter); + void Sort(string property, object descending); + + // Actual definition is "object Add( object )", just making it convenient + object Add(OlItemType type); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs new file mode 100644 index 000000000..f9a75f6dd --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/INameSpace.cs @@ -0,0 +1,14 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/bb176693%28v=office.12%29.aspx + /// + public interface INameSpace : ICommon { + IRecipient CurrentUser { + get; + } + IFolder GetDefaultFolder(OlDefaultFolders defaultFolder); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs new file mode 100644 index 000000000..6a29e5bda --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IOutlookApplication.cs @@ -0,0 +1,30 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Wrapper for Outlook.Application, see: http://msdn.microsoft.com/en-us/library/aa210897%28v=office.11%29.aspx + /// This is the initial COM-Object which is created/retrieved + /// + [ComProgId("Outlook.Application")] + public interface IOutlookApplication : ICommon { + string Name { + get; + } + string Version { + get; + } + IItem CreateItem(OlItemType ItemType); + object CreateItemFromTemplate(string TemplatePath, object InFolder); + object CreateObject(string ObjectName); + IInspector ActiveInspector(); + IInspectors Inspectors { + get; + } + INameSpace GetNameSpace(string type); + IExplorer ActiveExplorer(); + IExplorers Explorers { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs new file mode 100644 index 000000000..30d3267b9 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IPropertyAccessor.cs @@ -0,0 +1,12 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.propertyaccessor_members.aspx + /// + public interface IPropertyAccessor : ICommon { + void SetProperty(string SchemaName, object Value); + object GetProperty(string SchemaName); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs new file mode 100644 index 000000000..a7bdfa19a --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/IRecipient.cs @@ -0,0 +1,10 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public interface IRecipient : ICommon { + string Name { + get; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs new file mode 100644 index 000000000..42c1e38f9 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/MailItem.cs @@ -0,0 +1,51 @@ +using System; +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/ff861252.aspx + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mailitem.aspx + /// + public interface MailItem : IItem, ICommon { + bool Sent { + get; + } + object MAPIOBJECT { + get; + } + string HTMLBody { + get; + set; + } + DateTime ExpiryTime { + get; + set; + } + DateTime ReceivedTime { + get; + } + string SenderName { + get; + } + DateTime SentOn { + get; + } + OlBodyFormat BodyFormat { + get; + set; + } + string To { + get; + set; + } + string CC { + get; + set; + } + string BCC { + get; + set; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlAttachmentType.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlAttachmentType.cs new file mode 100644 index 000000000..ee92fe506 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlAttachmentType.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlAttachmentType { + // Fields + olByReference = 4, + olByValue = 1, + olEmbeddeditem = 5, + olOLE = 6 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlBodyFormat.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlBodyFormat.cs new file mode 100644 index 000000000..ca65b0e66 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlBodyFormat.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlBodyFormat { + // Fields + olFormatHTML = 2, + olFormatPlain = 1, + olFormatRichText = 3, + olFormatUnspecified = 0 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlDefaultFolders.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlDefaultFolders.cs new file mode 100644 index 000000000..867f636f8 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlDefaultFolders.cs @@ -0,0 +1,24 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlDefaultFolders { + olFolderCalendar = 9, // The Calendar folder. + olFolderConflicts = 19, // The Conflicts folder (subfolder of Sync Issues folder). Only available for an Exchange account. + olFolderContacts = 10, // The Contacts folder. + olFolderDeletedItems = 3, // The Deleted Items folder. + olFolderDrafts = 16, // The Drafts folder. + olFolderInbox = 6, // The Inbox folder. + olFolderJournal = 11, // The Journal folder. + olFolderJunk = 23, // The Junk E-Mail folder. + olFolderLocalFailures = 21, // The Local Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account. + olFolderManagedEmail = 29, // The top-level folder in the Managed Folders group. For more information on Managed Folders, see Help in Microsoft Outlook. Only available for an Exchange account. + olFolderNotes = 12, // The Notes folder. + olFolderOutbox = 4, // The Outbox folder. + olFolderSentMail = 5, // The Sent Mail folder. + olFolderServerFailures = 22, // The Server Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account. + olFolderSyncIssues = 20, // The Sync Issues folder. Only available for an Exchange account. + olFolderTasks = 13, // The Tasks folder. + olFolderToDo = 28, // The To Do folder. + olPublicFoldersAllPublicFolders = 18, // The All Public Folders folder in the Exchange Public Folders store. Only available for an Exchange account. + olFolderRssFeeds = 25 // The RSS Feeds folder. + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlEditorType.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlEditorType.cs new file mode 100644 index 000000000..ca4e94d07 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlEditorType.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlEditorType { + // Fields + olEditorHTML = 2, + olEditorRTF = 3, + olEditorText = 1, + olEditorWord = 4 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlInspectorClose.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlInspectorClose.cs new file mode 100644 index 000000000..54fe65594 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlInspectorClose.cs @@ -0,0 +1,9 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlInspectorClose { + // Fields + olDiscard = 1, + olPromptForSave = 2, + olSave = 0 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlItemType.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlItemType.cs new file mode 100644 index 000000000..269a78582 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlItemType.cs @@ -0,0 +1,14 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlItemType { + // Fields + olAppointmentItem = 1, + olContactItem = 2, + olDistributionListItem = 7, + olJournalItem = 4, + olMailItem = 0, + olNoteItem = 5, + olPostItem = 6, + olTaskItem = 3 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlObjectClass.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlObjectClass.cs new file mode 100644 index 000000000..197dc8774 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlObjectClass.cs @@ -0,0 +1,151 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/ff863329.aspx + /// + public enum OlObjectClass { + olAccount = 105, // Represents an Account object. + olAccountRuleCondition = 135, // Represents an AccountRuleCondition object. + olAccounts = 106, // Represents an Accounts object. + olAction = 32, // Represents an Action object. + olActions = 33, // Represents an Actions object. + olAddressEntries = 21, // Represents an AddressEntries object. + olAddressEntry = 8, // Represents an AddressEntry object. + olAddressList = 7, // Represents an AddressList object. + olAddressLists = 20, // Represents an AddressLists object. + olAddressRuleCondition = 170, // Represents an AddressRuleCondition object. + olApplication = 0, // Represents an Application object. + olAppointment = 26, // Represents an AppointmentItem object. + olAssignToCategoryRuleAction = 122, // Represents an AssignToCategoryRuleAction object. + olAttachment = 5, // Represents an Attachment object. + olAttachments = 18, // Represents an Attachments object. + olAttachmentSelection = 169, // Represents an AttachmentSelection object. + olAutoFormatRule = 147, // Represents an AutoFormatRule object. + olAutoFormatRules = 148, // Represents an AutoFormatRules object. + olCalendarModule = 159, // Represents a CalendarModule object. + olCalendarSharing = 151, // Represents a CalendarSharing object. + olCategories = 153, // Represents a Categories object. + olCategory = 152, // Represents a Category object. + olCategoryRuleCondition = 130, // Represents a CategoryRuleCondition object. + olClassBusinessCardView = 168, // Represents a BusinessCardView object. + olClassCalendarView = 139, // Represents a CalendarView object. + olClassCardView = 138, // Represents a CardView object. + olClassIconView = 137, // Represents a IconView object. + olClassNavigationPane = 155, // Represents a NavigationPane object. + olClassTableView = 136, // Represents a TableView object. + olClassTimeLineView = 140, // Represents a TimelineView object. + olClassTimeZone = 174, // Represents a TimeZone object. + olClassTimeZones = 175, // Represents a TimeZones object. + olColumn = 154, // Represents a Column object. + olColumnFormat = 149, // Represents a ColumnFormat object. + olColumns = 150, // Represents a Columns object. + olConflict = 102, // Represents a Conflict object. + olConflicts = 103, // Represents a Conflicts object. + olContact = 40, // Represents a ContactItem object. + olContactsModule = 160, // Represents a ContactsModule object. + olDistributionList = 69, // Represents a ExchangeDistributionList object. + olDocument = 41, // Represents a DocumentItem object. + olException = 30, // Represents an Exception object. + olExceptions = 29, // Represents an Exceptions object. + olExchangeDistributionList = 111, // Represents an ExchangeDistributionList object. + olExchangeUser = 110, // Represents an ExchangeUser object. + olExplorer = 34, // Represents an Explorer object. + olExplorers = 60, // Represents an Explorers object. + olFolder = 2, // Represents a Folder object. + olFolders = 15, // Represents a Folders object. + olFolderUserProperties = 172, // Represents a UserDefinedProperties object. + olFolderUserProperty = 171, // Represents a UserDefinedProperty object. + olFormDescription = 37, // Represents a FormDescription object. + olFormNameRuleCondition = 131, // Represents a FormNameRuleCondition object. + olFormRegion = 129, // Represents a FormRegion object. + olFromRssFeedRuleCondition = 173, // Represents a FromRssFeedRuleCondition object. + olFromRuleCondition = 132, // Represents a ToOrFromRuleCondition object. + olImportanceRuleCondition = 128, // Represents an ImportanceRuleCondition object. + olInspector = 35, // Represents an Inspector object. + olInspectors = 61, // Represents an Inspectors object. + olItemProperties = 98, // Represents an ItemProperties object. + olItemProperty = 99, // Represents an ItemProperty object. + olItems = 16, // Represents an Items object. + olJournal = 42, // Represents a JournalItem object. + olJournalModule = 162, // Represents a JournalModule object. + olLink = 75, // Represents a Link object. + olLinks = 76, // Represents a Links object. + olMail = 43, // Represents a MailItem object. + olMailModule = 158, // Represents a MailModule object. + olMarkAsTaskRuleAction = 124, // Represents a MarkAsTaskRuleAction object. + olMeetingCancellation = 54, // Represents a MeetingItem object that is a meeting cancellation notice. + olMeetingRequest = 53, // Represents a MeetingItem object that is a meeting request. + olMeetingResponseNegative = 55, // Represents a MeetingItem object that is a refusal of a meeting request. + olMeetingResponsePositive = 56, // Represents a MeetingItem object that is an acceptance of a meeting request. + olMeetingResponseTentative = 57, // Represents a MeetingItem object that is a tentative acceptance of a meeting request. + olMoveOrCopyRuleAction = 118, // Represents a MoveOrCopyRuleAction object. + olNamespace = 1, // Represents a NameSpace object. + olNavigationFolder = 167, // Represents a NavigationFolder object. + olNavigationFolders = 166, // Represents a NavigationFolders object. + olNavigationGroup = 165, // Represents a NavigationGroup object. + olNavigationGroups = 164, // Represents a NavigationGroups object. + olNavigationModule = 157, // Represents a NavigationModule object. + olNavigationModules = 156, // Represents a NavigationModules object. + olNewItemAlertRuleAction = 125, // Represents a NewItemAlertRuleAction object. + olNote = 44, // Represents a NoteItem object. + olNotesModule = 163, // Represents a NotesModule object. + olOrderField = 144, // Represents an OrderField object. + olOrderFields = 145, // Represents an OrderFields object. + olOutlookBarGroup = 66, // Represents an OutlookBarGroup object. + olOutlookBarGroups = 65, // Represents an OutlookBarGroups object. + olOutlookBarPane = 63, // Represents an OutlookBarPane object. + olOutlookBarShortcut = 68, // Represents an OutlookBarShortcut object. + olOutlookBarShortcuts = 67, // Represents an OutlookBarShortcuts object. + olOutlookBarStorage = 64, // Represents an OutlookBarStorage object. + olPages = 36, // Represents a Pages object. + olPanes = 62, // Represents a Panes object. + olPlaySoundRuleAction = 123, // Represents a PlaySoundRuleAction object. + olPost = 45, // Represents a PostItem object. + olPropertyAccessor = 112, // Represents a PropertyAccessor object. + olPropertyPages = 71, // Represents a PropertyPages object. + olPropertyPageSite = 70, // Represents a PropertyPageSite object. + olRecipient = 4, // Represents a Recipient object. + olRecipients = 17, // Represents a Recipients object. + olRecurrencePattern = 28, // Represents a RecurrencePattern object. + olReminder = 101, // Represents a Reminder object. + olReminders = 100, // Represents a Reminders object. + olRemote = 47, // Represents a RemoteItem object. + olReport = 46, // Represents a ReportItem object. + olResults = 78, // Represents a Results object. + olRow = 121, // Represents a Row object. + olRule = 115, // Represents a Rule object. + olRuleAction = 117, // Represents a RuleAction object. + olRuleActions = 116, // Represents a RuleAction object. + olRuleCondition = 127, // Represents a RuleCondition object. + olRuleConditions = 126, // Represents a RuleConditions object. + olRules = 114, // Represents a Rules object. + olSearch = 77, // Represents a Search object. + olSelection = 74, // Represents a Selection object. + olSelectNamesDialog = 109, // Represents a SelectNamesDialog object. + olSenderInAddressListRuleCondition = 133, // Represents a SenderInAddressListRuleCondition object. + olSendRuleAction = 119, // Represents a SendRuleAction object. + olSharing = 104, // Represents a SharingItem object. + olStorageItem = 113, // Represents a StorageItem object. + olStore = 107, // Represents a Store object. + olStores = 108, // Represents a Stores object. + olSyncObject = 72, // Represents a SyncObject object. + olSyncObjects = 73, // Represents a SyncObject object. + olTable = 120, // Represents a Table object. + olTask = 48, // Represents a TaskItem object. + olTaskRequest = 49, // Represents a TaskRequestItem object. + olTaskRequestAccept = 51, // Represents a TaskRequestAcceptItem object. + olTaskRequestDecline = 52, // Represents a TaskRequestDeclineItem object. + olTaskRequestUpdate = 50, // Represents a TaskRequestUpdateItem object. + olTasksModule = 161, // Represents a TasksModule object. + olTextRuleCondition = 134, // Represents a TextRuleCondition object. + olUserDefinedProperties = 172, // Represents a UserDefinedProperties object. + olUserDefinedProperty = 171, // Represents a UserDefinedProperty object. + olUserProperties = 38, // Represents a UserProperties object. + olUserProperty = 39, // Represents a UserProperty object. + olView = 80, // Represents a View object. + olViewField = 142, // Represents a ViewField object. + olViewFields = 141, // Represents a ViewFields object. + olViewFont = 146, // Represents a ViewFont object. + olViews = 79 // Represents a Views object. + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlReoccurenceState.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlReoccurenceState.cs new file mode 100644 index 000000000..9ca79ce3a --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlReoccurenceState.cs @@ -0,0 +1,9 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlReoccurenceState { + olApptException, + olApptMaster, + olApptNotRecurring, + olApptOccurrence + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlSensitivity.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlSensitivity.cs new file mode 100644 index 000000000..84206c0ac --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlSensitivity.cs @@ -0,0 +1,10 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlSensitivity { + // Fields + olConfidential = 3, + olNormal = 0, + olPersonal = 1, + olPrivate = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/OlWindowState.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlWindowState.cs new file mode 100644 index 000000000..732717d82 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OlWindowState.cs @@ -0,0 +1,9 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + public enum OlWindowState { + // Fields + olMaximized = 0, + olMinimized = 1, + olNormalWindow = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OutlookUtils.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/OutlookUtils.cs similarity index 97% rename from GreenshotOfficePlugin/OfficeInterop/OutlookUtils.cs rename to GreenshotOfficePlugin/OfficeInterop/Outlook/OutlookUtils.cs index 5b2975392..37fed0720 100644 --- a/GreenshotOfficePlugin/OfficeInterop/OutlookUtils.cs +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/OutlookUtils.cs @@ -18,10 +18,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ + using System; using System.Runtime.InteropServices; -namespace Greenshot.Interop.Office { +namespace GreenshotOfficePlugin.OfficeInterop.Outlook { internal enum PT : uint { PT_UNSPECIFIED = 0, /* (Reserved for interface use) type doesn't matter to caller */ PT_NULL = 1, /* NULL property value */ diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/PropTag.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/PropTag.cs new file mode 100644 index 000000000..4e7ccd37c --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/PropTag.cs @@ -0,0 +1,31 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +namespace GreenshotOfficePlugin.OfficeInterop.Outlook { + /// + /// Schema definitions for the MAPI properties + /// See: http://msdn.microsoft.com/en-us/library/aa454438.aspx + /// and see: http://msdn.microsoft.com/en-us/library/bb446117.aspx + /// + public static class PropTag { + public const string ATTACHMENT_CONTENT_ID = @"http://schemas.microsoft.com/mapi/proptag/0x3712001E"; + } +} diff --git a/GreenshotOfficePlugin/OfficeInterop/Outlook/WdUnits.cs b/GreenshotOfficePlugin/OfficeInterop/Outlook/WdUnits.cs new file mode 100644 index 000000000..31fd6f018 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Outlook/WdUnits.cs @@ -0,0 +1,24 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Outlook +{ + /// + /// Units: http://msdn.microsoft.com/en-us/library/office/bb214015(v=office.12).aspx + /// + public enum WdUnits { + wdCell = 12, + wdCharacter = 1, + wdCharacterFormatting = 13, + wdColumn = 9, + wdItem = 16, + wdLine = 5, + wdParagraph = 4, + wdParagraphFormatting = 14, + wdRow = 10, + wdScreen = 7, + wdSection = 8, + wdSentence = 3, + wdStory = 6, + wdTable = 15, + wdWindow = 11, + wdWord = 2 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/OutlookInterop.cs b/GreenshotOfficePlugin/OfficeInterop/OutlookInterop.cs deleted file mode 100644 index d9d0c7714..000000000 --- a/GreenshotOfficePlugin/OfficeInterop/OutlookInterop.cs +++ /dev/null @@ -1,660 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; - -namespace Greenshot.Interop.Office { - /// - /// Wrapper for Outlook.Application, see: http://msdn.microsoft.com/en-us/library/aa210897%28v=office.11%29.aspx - /// This is the initial COM-Object which is created/retrieved - /// - [ComProgId("Outlook.Application")] - public interface IOutlookApplication : ICommon { - string Name { - get; - } - string Version { - get; - } - IItem CreateItem(OlItemType ItemType); - object CreateItemFromTemplate(string TemplatePath, object InFolder); - object CreateObject(string ObjectName); - IInspector ActiveInspector(); - IInspectors Inspectors { - get; - } - INameSpace GetNameSpace(string type); - IExplorer ActiveExplorer(); - IExplorers Explorers { - get; - } - } - - - /// - /// See: http://msdn.microsoft.com/en-us/library/bb208387%28v=office.12%29.aspx - /// - public interface IItems : ICollection, IEnumerable { - IItem this[object index] { - get; - } - IItem GetFirst(); - IItem GetNext(); - IItem GetLast(); - IItem GetPrevious(); - - bool IncludeRecurrences { - get; - set; - } - - IItems Restrict(string filter); - void Sort(string property, object descending); - - // Actual definition is "object Add( object )", just making it convenient - object Add(OlItemType type); - } - - // Common attributes of all the Items (MailItem, AppointmentItem) - // See: http://msdn.microsoft.com/en-us/library/ff861252.aspx - public interface IItem : ICommon { - IAttachments Attachments { - get; - } - string Body { - get; - set; - } - OlObjectClass Class { - get; - } - DateTime CreationTime { - get; - } - string EntryID { - get; - } - DateTime LastModificationTime { - get; - } - string MessageClass { - get; - set; - } - bool NoAging { - get; - set; - } - int OutlookInternalVersion { - get; - } - string OutlookVersion { - get; - } - bool Saved { - get; - } - OlSensitivity Sensitivity { - get; - set; - } - int Size { - get; - } - string Subject { - get; - set; - } - bool UnRead { - get; - set; - } - object Copy(); - void Display(bool Modal); - void Save(); - IPropertyAccessor PropertyAccessor { - get; - } - IInspector GetInspector(); - } - - // See: http://msdn.microsoft.com/en-us/library/ff861252.aspx - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mailitem.aspx - public interface MailItem : IItem, ICommon { - bool Sent { - get; - } - object MAPIOBJECT { - get; - } - string HTMLBody { - get; - set; - } - DateTime ExpiryTime { - get; - set; - } - DateTime ReceivedTime { - get; - } - string SenderName { - get; - } - DateTime SentOn { - get; - } - OlBodyFormat BodyFormat { - get; - set; - } - string To { - get; - set; - } - string CC { - get; - set; - } - string BCC { - get; - set; - } - } - - // See: http://msdn.microsoft.com/en-us/library/ff869026.aspx - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.appointmentitem.aspx - public interface AppointmentItem : IItem, ICommon { - string Organizer { - get; - set; - } - string SendUsingAccount { - get; - } - string Categories { - get; - } - DateTime Start { - get; - } - DateTime End { - get; - } - OlReoccurenceState RecurrenceState { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.contactitem.aspx - public interface IContactItem : IItem, ICommon { - bool HasPicture { - get; - } - void SaveBusinessCardImage(string path); - void AddPicture(string path); - void RemovePicture(); - string FirstName { - get; - set; - } - string LastName { - get; - set; - } - } - - public interface IAttachments : ICollection { - IAttachment Add(object source, object type, object position, object displayName); - // Use index+1!!!! - IAttachment this[object index] { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.attachment_members.aspx - public interface IAttachment : ICommon { - string DisplayName { - get; - set; - } - string FileName { - get; - } - OlAttachmentType Type { - get; - } - IPropertyAccessor PropertyAccessor { - get; - } - object MAPIOBJECT { - get; - } - void SaveAsFile(string path); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.propertyaccessor_members.aspx - public interface IPropertyAccessor : ICommon { - void SetProperty(string SchemaName, object Value); - object GetProperty(string SchemaName); - } - - // Schema definitions for the MAPI properties - // See: http://msdn.microsoft.com/en-us/library/aa454438.aspx - // and see: http://msdn.microsoft.com/en-us/library/bb446117.aspx - public static class PropTag { - public const string ATTACHMENT_CONTENT_ID = @"http://schemas.microsoft.com/mapi/proptag/0x3712001E"; - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/bb176693%28v=office.12%29.aspx - /// - public interface INameSpace : ICommon { - IRecipient CurrentUser { - get; - } - IFolder GetDefaultFolder(OlDefaultFolders defaultFolder); - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/bb176362%28v=office.12%29.aspx - /// - public interface IFolder : ICommon { - IItems Items { - get; - } - } - - public interface IRecipient : ICommon { - string Name { - get; - } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.inspector_members.aspx - /// - public interface IInspector : ICommonExplorer { - IItem CurrentItem { - get; - } - OlEditorType EditorType { - get; - } - object ModifiedFormPages { - get; - } - void Close(OlInspectorClose SaveMode); - void Display(object Modal); - void HideFormPage(string PageName); - bool IsWordMail(); - void SetCurrentFormPage(string PageName); - void ShowFormPage(string PageName); - object HTMLEditor { - get; - } - IWordDocument WordEditor { - get; - } - void SetControlItemProperty(object Control, string PropertyName); - } - - /// - /// Is a joined interface of the Explorer an Inspector - /// - public interface ICommonExplorer : ICommon { - void Activate(); - string Caption { - get; - } - int Height { - get; - set; - } - int Left { - get; - set; - } - int Top { - get; - set; - } - int Width { - get; - set; - } - OlWindowState WindowState { - get; - set; - } - } - - /// - /// Since Outlook 2010, but since 2013 one can edit inside an explorer - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.explorer_members(v=office.15).aspx - /// - /// - public interface IExplorer : ICommonExplorer { - IItem ActiveInlineResponse { - get; - } - IWordDocument ActiveInlineResponseWordEditor { - get; - } - } - - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._application.inspectors.aspx - public interface IInspectors : ICommon, ICollection, IEnumerable { - // Use index + 1!! - IInspector this[object Index] { - get; - } - } - - /// - /// Since Outlook 2010, but since 2013 one can edit inside an explorer - /// See: http://msdn.microsoft.com/en-us/library/office/ff867227(v=office.15).aspx - /// - public interface IExplorers : ICommon, ICollection, IEnumerable { - // Use index + 1!! - IExplorer this[object Index] { - get; - } - } - - /// - /// Specifies which EmailFormat the email needs to use - /// - public enum EmailFormat { - Text, - HTML - } - public enum OlBodyFormat { - // Fields - olFormatHTML = 2, - olFormatPlain = 1, - olFormatRichText = 3, - olFormatUnspecified = 0 - } - - public enum OlAttachmentType { - // Fields - olByReference = 4, - olByValue = 1, - olEmbeddeditem = 5, - olOLE = 6 - } - - public enum OlSensitivity { - // Fields - olConfidential = 3, - olNormal = 0, - olPersonal = 1, - olPrivate = 2 - } - - // See: http://msdn.microsoft.com/en-us/library/ff863329.aspx - public enum OlObjectClass { - olAccount = 105, // Represents an Account object. - olAccountRuleCondition = 135, // Represents an AccountRuleCondition object. - olAccounts = 106, // Represents an Accounts object. - olAction = 32, // Represents an Action object. - olActions = 33, // Represents an Actions object. - olAddressEntries = 21, // Represents an AddressEntries object. - olAddressEntry = 8, // Represents an AddressEntry object. - olAddressList = 7, // Represents an AddressList object. - olAddressLists = 20, // Represents an AddressLists object. - olAddressRuleCondition = 170, // Represents an AddressRuleCondition object. - olApplication = 0, // Represents an Application object. - olAppointment = 26, // Represents an AppointmentItem object. - olAssignToCategoryRuleAction = 122, // Represents an AssignToCategoryRuleAction object. - olAttachment = 5, // Represents an Attachment object. - olAttachments = 18, // Represents an Attachments object. - olAttachmentSelection = 169, // Represents an AttachmentSelection object. - olAutoFormatRule = 147, // Represents an AutoFormatRule object. - olAutoFormatRules = 148, // Represents an AutoFormatRules object. - olCalendarModule = 159, // Represents a CalendarModule object. - olCalendarSharing = 151, // Represents a CalendarSharing object. - olCategories = 153, // Represents a Categories object. - olCategory = 152, // Represents a Category object. - olCategoryRuleCondition = 130, // Represents a CategoryRuleCondition object. - olClassBusinessCardView = 168, // Represents a BusinessCardView object. - olClassCalendarView = 139, // Represents a CalendarView object. - olClassCardView = 138, // Represents a CardView object. - olClassIconView = 137, // Represents a IconView object. - olClassNavigationPane = 155, // Represents a NavigationPane object. - olClassTableView = 136, // Represents a TableView object. - olClassTimeLineView = 140, // Represents a TimelineView object. - olClassTimeZone = 174, // Represents a TimeZone object. - olClassTimeZones = 175, // Represents a TimeZones object. - olColumn = 154, // Represents a Column object. - olColumnFormat = 149, // Represents a ColumnFormat object. - olColumns = 150, // Represents a Columns object. - olConflict = 102, // Represents a Conflict object. - olConflicts = 103, // Represents a Conflicts object. - olContact = 40, // Represents a ContactItem object. - olContactsModule = 160, // Represents a ContactsModule object. - olDistributionList = 69, // Represents a ExchangeDistributionList object. - olDocument = 41, // Represents a DocumentItem object. - olException = 30, // Represents an Exception object. - olExceptions = 29, // Represents an Exceptions object. - olExchangeDistributionList = 111, // Represents an ExchangeDistributionList object. - olExchangeUser = 110, // Represents an ExchangeUser object. - olExplorer = 34, // Represents an Explorer object. - olExplorers = 60, // Represents an Explorers object. - olFolder = 2, // Represents a Folder object. - olFolders = 15, // Represents a Folders object. - olFolderUserProperties = 172, // Represents a UserDefinedProperties object. - olFolderUserProperty = 171, // Represents a UserDefinedProperty object. - olFormDescription = 37, // Represents a FormDescription object. - olFormNameRuleCondition = 131, // Represents a FormNameRuleCondition object. - olFormRegion = 129, // Represents a FormRegion object. - olFromRssFeedRuleCondition = 173, // Represents a FromRssFeedRuleCondition object. - olFromRuleCondition = 132, // Represents a ToOrFromRuleCondition object. - olImportanceRuleCondition = 128, // Represents an ImportanceRuleCondition object. - olInspector = 35, // Represents an Inspector object. - olInspectors = 61, // Represents an Inspectors object. - olItemProperties = 98, // Represents an ItemProperties object. - olItemProperty = 99, // Represents an ItemProperty object. - olItems = 16, // Represents an Items object. - olJournal = 42, // Represents a JournalItem object. - olJournalModule = 162, // Represents a JournalModule object. - olLink = 75, // Represents a Link object. - olLinks = 76, // Represents a Links object. - olMail = 43, // Represents a MailItem object. - olMailModule = 158, // Represents a MailModule object. - olMarkAsTaskRuleAction = 124, // Represents a MarkAsTaskRuleAction object. - olMeetingCancellation = 54, // Represents a MeetingItem object that is a meeting cancellation notice. - olMeetingRequest = 53, // Represents a MeetingItem object that is a meeting request. - olMeetingResponseNegative = 55, // Represents a MeetingItem object that is a refusal of a meeting request. - olMeetingResponsePositive = 56, // Represents a MeetingItem object that is an acceptance of a meeting request. - olMeetingResponseTentative = 57, // Represents a MeetingItem object that is a tentative acceptance of a meeting request. - olMoveOrCopyRuleAction = 118, // Represents a MoveOrCopyRuleAction object. - olNamespace = 1, // Represents a NameSpace object. - olNavigationFolder = 167, // Represents a NavigationFolder object. - olNavigationFolders = 166, // Represents a NavigationFolders object. - olNavigationGroup = 165, // Represents a NavigationGroup object. - olNavigationGroups = 164, // Represents a NavigationGroups object. - olNavigationModule = 157, // Represents a NavigationModule object. - olNavigationModules = 156, // Represents a NavigationModules object. - olNewItemAlertRuleAction = 125, // Represents a NewItemAlertRuleAction object. - olNote = 44, // Represents a NoteItem object. - olNotesModule = 163, // Represents a NotesModule object. - olOrderField = 144, // Represents an OrderField object. - olOrderFields = 145, // Represents an OrderFields object. - olOutlookBarGroup = 66, // Represents an OutlookBarGroup object. - olOutlookBarGroups = 65, // Represents an OutlookBarGroups object. - olOutlookBarPane = 63, // Represents an OutlookBarPane object. - olOutlookBarShortcut = 68, // Represents an OutlookBarShortcut object. - olOutlookBarShortcuts = 67, // Represents an OutlookBarShortcuts object. - olOutlookBarStorage = 64, // Represents an OutlookBarStorage object. - olPages = 36, // Represents a Pages object. - olPanes = 62, // Represents a Panes object. - olPlaySoundRuleAction = 123, // Represents a PlaySoundRuleAction object. - olPost = 45, // Represents a PostItem object. - olPropertyAccessor = 112, // Represents a PropertyAccessor object. - olPropertyPages = 71, // Represents a PropertyPages object. - olPropertyPageSite = 70, // Represents a PropertyPageSite object. - olRecipient = 4, // Represents a Recipient object. - olRecipients = 17, // Represents a Recipients object. - olRecurrencePattern = 28, // Represents a RecurrencePattern object. - olReminder = 101, // Represents a Reminder object. - olReminders = 100, // Represents a Reminders object. - olRemote = 47, // Represents a RemoteItem object. - olReport = 46, // Represents a ReportItem object. - olResults = 78, // Represents a Results object. - olRow = 121, // Represents a Row object. - olRule = 115, // Represents a Rule object. - olRuleAction = 117, // Represents a RuleAction object. - olRuleActions = 116, // Represents a RuleAction object. - olRuleCondition = 127, // Represents a RuleCondition object. - olRuleConditions = 126, // Represents a RuleConditions object. - olRules = 114, // Represents a Rules object. - olSearch = 77, // Represents a Search object. - olSelection = 74, // Represents a Selection object. - olSelectNamesDialog = 109, // Represents a SelectNamesDialog object. - olSenderInAddressListRuleCondition = 133, // Represents a SenderInAddressListRuleCondition object. - olSendRuleAction = 119, // Represents a SendRuleAction object. - olSharing = 104, // Represents a SharingItem object. - olStorageItem = 113, // Represents a StorageItem object. - olStore = 107, // Represents a Store object. - olStores = 108, // Represents a Stores object. - olSyncObject = 72, // Represents a SyncObject object. - olSyncObjects = 73, // Represents a SyncObject object. - olTable = 120, // Represents a Table object. - olTask = 48, // Represents a TaskItem object. - olTaskRequest = 49, // Represents a TaskRequestItem object. - olTaskRequestAccept = 51, // Represents a TaskRequestAcceptItem object. - olTaskRequestDecline = 52, // Represents a TaskRequestDeclineItem object. - olTaskRequestUpdate = 50, // Represents a TaskRequestUpdateItem object. - olTasksModule = 161, // Represents a TasksModule object. - olTextRuleCondition = 134, // Represents a TextRuleCondition object. - olUserDefinedProperties = 172, // Represents a UserDefinedProperties object. - olUserDefinedProperty = 171, // Represents a UserDefinedProperty object. - olUserProperties = 38, // Represents a UserProperties object. - olUserProperty = 39, // Represents a UserProperty object. - olView = 80, // Represents a View object. - olViewField = 142, // Represents a ViewField object. - olViewFields = 141, // Represents a ViewFields object. - olViewFont = 146, // Represents a ViewFont object. - olViews = 79 // Represents a Views object. - } - - public enum OlDefaultFolders { - olFolderCalendar = 9, // The Calendar folder. - olFolderConflicts = 19, // The Conflicts folder (subfolder of Sync Issues folder). Only available for an Exchange account. - olFolderContacts = 10, // The Contacts folder. - olFolderDeletedItems = 3, // The Deleted Items folder. - olFolderDrafts = 16, // The Drafts folder. - olFolderInbox = 6, // The Inbox folder. - olFolderJournal = 11, // The Journal folder. - olFolderJunk = 23, // The Junk E-Mail folder. - olFolderLocalFailures = 21, // The Local Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account. - olFolderManagedEmail = 29, // The top-level folder in the Managed Folders group. For more information on Managed Folders, see Help in Microsoft Outlook. Only available for an Exchange account. - olFolderNotes = 12, // The Notes folder. - olFolderOutbox = 4, // The Outbox folder. - olFolderSentMail = 5, // The Sent Mail folder. - olFolderServerFailures = 22, // The Server Failures folder (subfolder of Sync Issues folder). Only available for an Exchange account. - olFolderSyncIssues = 20, // The Sync Issues folder. Only available for an Exchange account. - olFolderTasks = 13, // The Tasks folder. - olFolderToDo = 28, // The To Do folder. - olPublicFoldersAllPublicFolders = 18, // The All Public Folders folder in the Exchange Public Folders store. Only available for an Exchange account. - olFolderRssFeeds = 25 // The RSS Feeds folder. - } - - public enum OlItemType { - // Fields - olAppointmentItem = 1, - olContactItem = 2, - olDistributionListItem = 7, - olJournalItem = 4, - olMailItem = 0, - olNoteItem = 5, - olPostItem = 6, - olTaskItem = 3 - } - - public enum OlEditorType { - // Fields - olEditorHTML = 2, - olEditorRTF = 3, - olEditorText = 1, - olEditorWord = 4 - } - - public enum OlWindowState { - // Fields - olMaximized = 0, - olMinimized = 1, - olNormalWindow = 2 - } - - public enum OlInspectorClose { - // Fields - olDiscard = 1, - olPromptForSave = 2, - olSave = 0 - } - - public enum MsoTriState { - msoTrue = -1, - msoFalse = 0, - msoCTrue = 1, - msoTriStateToggle = -3, - msoTriStateMixed = -2 - } - - public enum OlReoccurenceState { - olApptException, - olApptMaster, - olApptNotRecurring, - olApptOccurrence - } - - public enum MsoScaleFrom { - msoScaleFromTopLeft = 0, - msoScaleFromMiddle = 1, - msoScaleFromBottomRight = 2 - } - - /// - /// Units: http://msdn.microsoft.com/en-us/library/office/bb214015(v=office.12).aspx - /// - public enum WdUnits { - wdCell = 12, - wdCharacter = 1, - wdCharacterFormatting = 13, - wdColumn = 9, - wdItem = 16, - wdLine = 5, - wdParagraph = 4, - wdParagraphFormatting = 14, - wdRow = 10, - wdScreen = 7, - wdSection = 8, - wdSentence = 3, - wdStory = 6, - wdTable = 15, - wdWindow = 11, - wdWord = 2 - } -} diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs new file mode 100644 index 000000000..cc3942003 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPageSetup.cs @@ -0,0 +1,12 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.pagesetup_members.aspx + /// + public interface IPageSetup : ICommon, ICollection { + float SlideWidth { get; set; } + float SlideHeight { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs new file mode 100644 index 000000000..87604065b --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointApplication.cs @@ -0,0 +1,37 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint { + /// + /// See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.application_members.aspx + /// + [ComProgId("Powerpoint.Application")] + public interface IPowerpointApplication : ICommon { + IPresentation ActivePresentation { get; } + IPresentations Presentations { get; } + bool Visible { get; set; } + void Activate(); + IPowerpointWindow ActiveWindow { get; } + string Version { get; } + } +} diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs new file mode 100644 index 000000000..86d7ab3de --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointView.cs @@ -0,0 +1,13 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Word; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.view_members.aspx + /// + public interface IPowerpointView : ICommon { + IZoom Zoom { get; } + void GotoSlide(int index); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs new file mode 100644 index 000000000..bc80c4ad2 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPowerpointWindow.cs @@ -0,0 +1,12 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.documentwindow.view.aspx + /// + public interface IPowerpointWindow : ICommon { + void Activate(); + IPowerpointView View { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs new file mode 100644 index 000000000..bbe0d377a --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentation.cs @@ -0,0 +1,17 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentation_members.aspx + /// + public interface IPresentation : ICommon { + string Name { get; } + ISlides Slides { get; } + IPowerpointApplication Application { get; } + MsoTriState ReadOnly { get; } + bool Final { get; set; } + IPageSetup PageSetup { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs new file mode 100644 index 000000000..237f8a079 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IPresentations.cs @@ -0,0 +1,13 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentations_members.aspx + /// + public interface IPresentations : ICommon, ICollection { + IPresentation Add(MsoTriState WithWindow); + IPresentation item(int index); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs new file mode 100644 index 000000000..e91d3e280 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShape.cs @@ -0,0 +1,20 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shape_members.aspx + /// + public interface IShape : ICommon { + float Left { get; set; } + float Top { get; set; } + float Width { get; set; } + float Height { get; set; } + ITextFrame TextFrame { get; } + void ScaleWidth(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); + void ScaleHeight(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); + string AlternativeText { get; set; } + MsoTriState LockAspectRatio { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs new file mode 100644 index 000000000..27ee9310f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/IShapes.cs @@ -0,0 +1,15 @@ +using System.Collections; +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shapes_members.aspx + /// + public interface IShapes : ICommon, IEnumerable { + int Count { get; } + IShape item(int index); + IShape AddPicture(string FileName, MsoTriState LinkToFile, MsoTriState SaveWithDocument, float Left, float Top, float Width, float Height); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs new file mode 100644 index 000000000..c68d8fd83 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlide.cs @@ -0,0 +1,14 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slide_members.aspx + /// + public interface ISlide : ICommon { + IShapes Shapes { get; } + void Select(); + int SlideNumber { get; } + + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs new file mode 100644 index 000000000..ead384422 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ISlides.cs @@ -0,0 +1,12 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slides_members.aspx + /// + public interface ISlides : ICommon { + int Count { get; } + ISlide Add(int Index, int layout); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs new file mode 100644 index 000000000..0aaffd10e --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextFrame.cs @@ -0,0 +1,10 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + public interface ITextFrame : ICommon { + ITextRange TextRange { get; } + MsoTriState HasText { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs new file mode 100644 index 000000000..38a960dc2 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/ITextRange.cs @@ -0,0 +1,8 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + public interface ITextRange : ICommon { + string Text { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Powerpoint/PPSlideLayout.cs b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/PPSlideLayout.cs new file mode 100644 index 000000000..371b749c7 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Powerpoint/PPSlideLayout.cs @@ -0,0 +1,42 @@ +namespace GreenshotOfficePlugin.OfficeInterop.Powerpoint +{ + public enum PPSlideLayout : int { + ppLayoutMixed = -2, + ppLayoutTitle = 1, + ppLayoutText = 2, + ppLayoutTwoColumnText = 3, + ppLayoutTable = 4, + ppLayoutTextAndChart = 5, + ppLayoutChartAndText = 6, + ppLayoutOrgchart = 7, + ppLayoutChart = 8, + ppLayoutTextAndClipart = 9, + ppLayoutClipartAndText = 10, + ppLayoutTitleOnly = 11, + ppLayoutBlank = 12, + ppLayoutTextAndObject = 13, + ppLayoutObjectAndText = 14, + ppLayoutLargeObject = 15, + ppLayoutObject = 16, + ppLayoutTextAndMediaClip = 17, + ppLayoutMediaClipAndText = 18, + ppLayoutObjectOverText = 19, + ppLayoutTextOverObject = 20, + ppLayoutTextAndTwoObjects = 21, + ppLayoutTwoObjectsAndText = 22, + ppLayoutTwoObjectsOverText = 23, + ppLayoutFourObjects = 24, + ppLayoutVerticalText = 25, + ppLayoutClipArtAndVerticalText = 26, + ppLayoutVerticalTitleAndText = 27, + ppLayoutVerticalTitleAndTextOverChart = 28, + ppLayoutTwoObjects = 29, + ppLayoutObjectAndTwoObjects = 30, + ppLayoutTwoObjectsAndObject = 31, + ppLayoutCustom = 32, + ppLayoutSectionHeader = 33, + ppLayoutComparison = 34, + ppLayoutContentWithCaption = 35, + ppLayoutPictureWithCaption = 36 + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/PowerpointInterop.cs b/GreenshotOfficePlugin/OfficeInterop/PowerpointInterop.cs deleted file mode 100644 index 1da0a8bbd..000000000 --- a/GreenshotOfficePlugin/OfficeInterop/PowerpointInterop.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System.Collections; - -namespace Greenshot.Interop.Office { - // See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.application_members.aspx - [ComProgId("Powerpoint.Application")] - public interface IPowerpointApplication : ICommon { - IPresentation ActivePresentation { get; } - IPresentations Presentations { get; } - bool Visible { get; set; } - void Activate(); - IPowerpointWindow ActiveWindow { get; } - string Version { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slides_members.aspx - public interface ISlides : ICommon { - int Count { get; } - ISlide Add(int Index, int layout); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.documentwindow.view.aspx - public interface IPowerpointWindow : ICommon { - void Activate(); - IPowerpointView View { get; } - } - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.view_members.aspx - public interface IPowerpointView : ICommon { - IZoom Zoom { get; } - void GotoSlide(int index); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentation_members.aspx - public interface IPresentation : ICommon { - string Name { get; } - ISlides Slides { get; } - IPowerpointApplication Application { get; } - MsoTriState ReadOnly { get; } - bool Final { get; set; } - IPageSetup PageSetup { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentations_members.aspx - public interface IPresentations : ICommon, ICollection { - IPresentation Add(MsoTriState WithWindow); - IPresentation item(int index); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.pagesetup_members.aspx - public interface IPageSetup : ICommon, ICollection { - float SlideWidth { get; set; } - float SlideHeight { get; set; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slide_members.aspx - public interface ISlide : ICommon { - IShapes Shapes { get; } - void Select(); - int SlideNumber { get; } - - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shapes_members.aspx - public interface IShapes : ICommon, IEnumerable { - int Count { get; } - IShape item(int index); - IShape AddPicture(string FileName, MsoTriState LinkToFile, MsoTriState SaveWithDocument, float Left, float Top, float Width, float Height); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shape_members.aspx - public interface IShape : ICommon { - float Left { get; set; } - float Top { get; set; } - float Width { get; set; } - float Height { get; set; } - ITextFrame TextFrame { get; } - void ScaleWidth(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); - void ScaleHeight(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); - string AlternativeText { get; set; } - MsoTriState LockAspectRatio { get; set; } - } - - public interface ITextFrame : ICommon { - ITextRange TextRange { get; } - MsoTriState HasText { get; } - } - public interface ITextRange : ICommon { - string Text { get; set; } - } - - public enum PPSlideLayout : int { - ppLayoutMixed = -2, - ppLayoutTitle = 1, - ppLayoutText = 2, - ppLayoutTwoColumnText = 3, - ppLayoutTable = 4, - ppLayoutTextAndChart = 5, - ppLayoutChartAndText = 6, - ppLayoutOrgchart = 7, - ppLayoutChart = 8, - ppLayoutTextAndClipart = 9, - ppLayoutClipartAndText = 10, - ppLayoutTitleOnly = 11, - ppLayoutBlank = 12, - ppLayoutTextAndObject = 13, - ppLayoutObjectAndText = 14, - ppLayoutLargeObject = 15, - ppLayoutObject = 16, - ppLayoutTextAndMediaClip = 17, - ppLayoutMediaClipAndText = 18, - ppLayoutObjectOverText = 19, - ppLayoutTextOverObject = 20, - ppLayoutTextAndTwoObjects = 21, - ppLayoutTwoObjectsAndText = 22, - ppLayoutTwoObjectsOverText = 23, - ppLayoutFourObjects = 24, - ppLayoutVerticalText = 25, - ppLayoutClipArtAndVerticalText = 26, - ppLayoutVerticalTitleAndText = 27, - ppLayoutVerticalTitleAndTextOverChart = 28, - ppLayoutTwoObjects = 29, - ppLayoutObjectAndTwoObjects = 30, - ppLayoutTwoObjectsAndObject = 31, - ppLayoutCustom = 32, - ppLayoutSectionHeader = 33, - ppLayoutComparison = 34, - ppLayoutContentWithCaption = 35, - ppLayoutPictureWithCaption = 36 - } -} diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs new file mode 100644 index 000000000..07dcc30e0 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IDocuments.cs @@ -0,0 +1,12 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents_members(v=office.11).aspx + /// + public interface IDocuments : ICommon, ICollection { + IWordDocument Add(ref object Template, ref object NewTemplate, ref object DocumentType, ref object Visible); + IWordDocument item(int index); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs new file mode 100644 index 000000000..565c93689 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlink.cs @@ -0,0 +1,14 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlink_members%28v=office.14%29.aspx + /// + public interface IHyperlink : ICommon { + string Address { + get; + set; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs new file mode 100644 index 000000000..21b69e231 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IHyperlinks.cs @@ -0,0 +1,11 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlinks%28v=office.14%29.aspx + /// + public interface IHyperlinks : ICommon, ICollection { + IHyperlink Add(object Anchor, object Address, object SubAddress, object ScreenTip, object TextToDisplay, object Target); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs new file mode 100644 index 000000000..224c5136f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShape.cs @@ -0,0 +1,16 @@ +using Greenshot.Interop; +using GreenshotOfficePlugin.OfficeInterop.Outlook; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.inlineshape_members%28v=office.14%29.aspx + /// + public interface IInlineShape : ICommon { + IHyperlink Hyperlink { get; } + MsoTriState LockAspectRatio { + get; + set; + } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs new file mode 100644 index 000000000..69541925f --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IInlineShapes.cs @@ -0,0 +1,11 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/ms263866%28v=office.14%29.aspx + /// + public interface IInlineShapes : ICommon { + IInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs new file mode 100644 index 000000000..42c1ee3aa --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IPane.cs @@ -0,0 +1,11 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pane_members.aspx + /// + public interface IPane : ICommon { + IWordView View { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs b/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs new file mode 100644 index 000000000..c7ff1571c --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/ISelection.cs @@ -0,0 +1,13 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.selection_members(v=office.11).aspx + /// + public interface ISelection : ICommon { + IInlineShapes InlineShapes { get; } + void InsertAfter(string text); + int MoveDown(object Unit, object Count, object Extend); + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs new file mode 100644 index 000000000..e7f16ef94 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordApplication.cs @@ -0,0 +1,35 @@ +/* + * Greenshot - a free and open source screenshot tool + * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom + * + * For more information see: http://getgreenshot.org/ + * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word { + // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx + [ComProgId("Word.Application")] + public interface IWordApplication : ICommon { + IWordDocument ActiveDocument { get; } + ISelection Selection { get; } + IDocuments Documents { get; } + bool Visible { get; set; } + void Activate(); + string Version { get; } + } +} diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs new file mode 100644 index 000000000..6515bd1b3 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordDocument.cs @@ -0,0 +1,18 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document%28v=office.14%29.aspx + /// + public interface IWordDocument : ICommon { + void Activate(); + IWordApplication Application { get; } + IWordWindow ActiveWindow { get; } + bool ReadOnly { get; } + IHyperlinks Hyperlinks { get; } + + // Only 2007 and later! + bool Final { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs new file mode 100644 index 000000000..8c2c72009 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordView.cs @@ -0,0 +1,11 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.view_members.aspx + /// + public interface IWordView : ICommon { + IZoom Zoom { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs new file mode 100644 index 000000000..1186c8f45 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IWordWindow.cs @@ -0,0 +1,20 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.window_members.aspx + /// + public interface IWordWindow : ICommon { + IPane ActivePane { get; } + void Activate(); + string Caption { + get; + } + + /// + /// Returns an Integer (int in C#) that indicates the window handle of the specified window + /// + int Hwnd { get; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs b/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs new file mode 100644 index 000000000..c8751fc28 --- /dev/null +++ b/GreenshotOfficePlugin/OfficeInterop/Word/IZoom.cs @@ -0,0 +1,11 @@ +using Greenshot.Interop; + +namespace GreenshotOfficePlugin.OfficeInterop.Word +{ + /// + /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.zoom_members.aspx + /// + public interface IZoom : ICommon { + int Percentage { get; set; } + } +} \ No newline at end of file diff --git a/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs b/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs deleted file mode 100644 index 337862dfe..000000000 --- a/GreenshotOfficePlugin/OfficeInterop/WordInterop.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2020 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on GitHub https://github.com/greenshot/greenshot - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -namespace Greenshot.Interop.Office { - // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx - [ComProgId("Word.Application")] - public interface IWordApplication : ICommon { - IWordDocument ActiveDocument { get; } - ISelection Selection { get; } - IDocuments Documents { get; } - bool Visible { get; set; } - void Activate(); - string Version { get; } - } - - // See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents_members(v=office.11).aspx - public interface IDocuments : ICommon, ICollection { - IWordDocument Add(ref object Template, ref object NewTemplate, ref object DocumentType, ref object Visible); - IWordDocument item(int index); - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document%28v=office.14%29.aspx - /// - public interface IWordDocument : ICommon { - void Activate(); - IWordApplication Application { get; } - IWordWindow ActiveWindow { get; } - bool ReadOnly { get; } - IHyperlinks Hyperlinks { get; } - - // Only 2007 and later! - bool Final { get; set; } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.window_members.aspx - /// - public interface IWordWindow : ICommon { - IPane ActivePane { get; } - void Activate(); - string Caption { - get; - } - - /// - /// Returns an Integer (int in C#) that indicates the window handle of the specified window - /// - int Hwnd { get; } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pane_members.aspx - /// - public interface IPane : ICommon { - IWordView View { get; } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.view_members.aspx - /// - public interface IWordView : ICommon { - IZoom Zoom { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.zoom_members.aspx - public interface IZoom : ICommon { - int Percentage { get; set; } - } - - /// - /// See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.selection_members(v=office.11).aspx - /// - public interface ISelection : ICommon { - IInlineShapes InlineShapes { get; } - void InsertAfter(string text); - int MoveDown(object Unit, object Count, object Extend); - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/ms263866%28v=office.14%29.aspx - /// - public interface IInlineShapes : ICommon { - IInlineShape AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range); - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.inlineshape_members%28v=office.14%29.aspx - /// - public interface IInlineShape : ICommon { - IHyperlink Hyperlink { get; } - MsoTriState LockAspectRatio { - get; - set; - } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlink_members%28v=office.14%29.aspx - /// - public interface IHyperlink : ICommon { - string Address { - get; - set; - } - } - - /// - /// See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.hyperlinks%28v=office.14%29.aspx - /// - public interface IHyperlinks : ICommon, ICollection { - IHyperlink Add(object Anchor, object Address, object SubAddress, object ScreenTip, object TextToDisplay, object Target); - } -} diff --git a/GreenshotOfficePlugin/OfficePlugin.cs b/GreenshotOfficePlugin/OfficePlugin.cs index 2b1228cb9..5befd5c30 100644 --- a/GreenshotOfficePlugin/OfficePlugin.cs +++ b/GreenshotOfficePlugin/OfficePlugin.cs @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; using Greenshot.Plugin; +using GreenshotOfficePlugin.Destinations; using GreenshotPlugin.Core; namespace GreenshotOfficePlugin {