~quequotion/glippy/glippy

« back to all changes in this revision

Viewing changes to src/core/Delegates.cs

  • Committer: Que Quotion
  • Date: 2018-07-01 13:34:36 UTC
  • Revision ID: quequotion@bugmenot.com-20180701133436-usy073goo274fh6a
Glippy: Simple, powerful clipboard manager

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Glippy
 
3
 * Copyright © 2010, 2011, 2012 Wojciech Kowalczyk
 
4
 * The program is distributed under the terms of the GNU General Public License Version 3.
 
5
 * See LICENCE for details.
 
6
 */
 
7
 
 
8
using Gdk;
 
9
 
 
10
namespace Glippy.Core
 
11
{
 
12
        /// <summary>
 
13
        /// Delegate used to pass menu methods.
 
14
        /// </summary>
 
15
        public delegate Gtk.Menu MenuFunc();    
 
16
        
 
17
        /// <summary>
 
18
        /// Delegate for ClipboardChanged event handler.
 
19
        /// </summary>
 
20
        public delegate void ClipboardChanged(object sender, ClipboardChangedArgs args);        
 
21
        
 
22
        /// <summary>
 
23
        /// Delegate for SettingChanged event handler.
 
24
        /// </summary>
 
25
        public delegate void SettingChanged(object sender, SettingChangedArgs args);
 
26
        
 
27
        /// <summary>
 
28
        /// Clipboard changed arguments.
 
29
        /// </summary>
 
30
        public class ClipboardChangedArgs
 
31
        {
 
32
                /// <summary>
 
33
                /// Gets atom which represents clipboard which has been changed.
 
34
                /// </summary>
 
35
                public Atom Clipboard { get; private set; }
 
36
                
 
37
                /// <summary>
 
38
                /// Gets previous clipboard item.
 
39
                /// </summary>
 
40
                public Item OldValue { get; private set; }
 
41
                
 
42
                /// <summary>
 
43
                /// Gets current clipboard item.
 
44
                /// </summary>
 
45
                public Item NewValue { get; private set; }
 
46
                
 
47
                /// <summary>
 
48
                /// Initializes a new instance of the ClipboardChangedArgs class.
 
49
                /// </summary>
 
50
                /// <param name="clipboard">Atom of clipboard which has been changed.</param>
 
51
                /// <param name="oldValue">Previous clipboard item.</param>
 
52
                /// <param name="newValue">Current clipboard item.</param>
 
53
                public ClipboardChangedArgs(Atom clipboard, Item oldValue, Item newValue)
 
54
                {
 
55
                        this.Clipboard = clipboard;
 
56
                        this.OldValue = oldValue;
 
57
                        this.NewValue = newValue;
 
58
                }
 
59
        }
 
60
        
 
61
        /// <summary>
 
62
    /// Setting changed arguments.
 
63
    /// </summary>
 
64
        public class SettingChangedArgs
 
65
        {
 
66
                /// <summary>
 
67
                /// Gets the key which has been changed.
 
68
                /// </summary>
 
69
                public string Key { get; private set; }
 
70
                
 
71
                /// <summary>
 
72
                /// If set, menu needs to be rebuilt because of setting change.
 
73
                /// </summary>
 
74
                public bool RequiresMenuRebuild { get; private set; }
 
75
                
 
76
                /// <summary>
 
77
                /// Creates new instance of SettingChangedArgs.
 
78
                /// </summary>
 
79
                /// <param name="key">Key which has been changed.</param>
 
80
                /// <param name="requiresMenuRebuild">Indicates whether menu needs to be rebuilt.</param>               
 
81
                public SettingChangedArgs(string key, bool requiresMenuRebuild)
 
82
                {
 
83
                        this.Key = key;
 
84
                        this.RequiresMenuRebuild = requiresMenuRebuild;
 
85
                }
 
86
        }
 
87
}