Remove formatting tab in global settings of gnome port
[modest] / src / modest-email-clipboard.h
1 /* Copyright (c) 2006, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  *   notice, this list of conditions and the following disclaimer in the
12  *   documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Nokia Corporation nor the names of its
14  *   contributors may be used to endorse or promote products derived from
15  *   this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29
30
31 #ifndef __MODEST_EMAIL_CLIPBOARD_H__
32 #define __MODEST_EMAIL_CLIPBOARD_H__
33
34 #include <glib-object.h>
35 #include <modest-conf.h>
36 #include <tny-folder.h>
37
38 G_BEGIN_DECLS
39
40 /* convenience macros */
41 #define MODEST_TYPE_EMAIL_CLIPBOARD             (modest_email_clipboard_get_type())
42 #define MODEST_EMAIL_CLIPBOARD(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_EMAIL_CLIPBOARD,ModestEmailClipboard))
43 #define MODEST_EMAIL_CLIPBOARD_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_EMAIL_CLIPBOARD,ModestEmailClipboardClass))
44 #define MODEST_IS_EMAIL_CLIPBOARD(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_EMAIL_CLIPBOARD))
45 #define MODEST_IS_EMAIL_CLIPBOARD_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_EMAIL_CLIPBOARD))
46 #define MODEST_EMAIL_CLIPBOARD_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_EMAIL_CLIPBOARD,ModestEmailClipboardClass))
47
48 typedef struct _ModestEmailClipboard      ModestEmailClipboard;
49 typedef struct _ModestEmailClipboardClass ModestEmailClipboardClass;
50 typedef struct _ModestEmailClipboardPrivate ModestEmailClipboardPrivate;
51
52 struct _ModestEmailClipboard {
53          GObject parent;
54         ModestEmailClipboardPrivate *priv;
55 };
56
57 struct _ModestEmailClipboardClass {
58         GObjectClass parent_class;
59
60 };
61
62 /**
63  * modest_email_clipboard_get_type:
64  * 
65  * get the GType for #ModestEmailClipboard
66  *  
67  * Returns: the GType
68  */
69 GType           modest_email_clipboard_get_type       (void) G_GNUC_CONST;
70
71
72 /**
73  * modest_email_clipboard_new:
74  *  
75  * Returns: a new #ModestEmailClipboard, or NULL in case of error
76  */
77 ModestEmailClipboard*        modest_email_clipboard_new (void);
78
79
80 /**
81  * modest_email_clipboard_get_data:
82  * @self: a #ModestEmailClipboard singlenton instance.   
83  * @src_folder: a #TnyFolder instance which is the source of selection data. 
84  * @data: a #TnyList of objects to manage.
85  * @delete: determines whether data will be removed after copy them.
86  *  
87  * Gets data from clipboard to manage them with copy, cut and paste operations.
88  * Currently imementation allows #TnyFolder or #TnyHeader objects.
89  *
90  * After getting data, clipboard will be cleared.
91  */
92 void
93 modest_email_clipboard_get_data (ModestEmailClipboard *self,
94                                  TnyFolder **src_folder,
95                                  TnyList **data,
96                                  gboolean *delete);
97
98 /**
99  * modest_email_clipboard_set_data:
100  * @self: a #ModestEmailClipboard singlenton instance.   
101  * @src_folder: a #TnyFolder instance which is the source of selection data. 
102  * @data: a #TnyList of objects to manage.
103  * @delete: determines whether data will be removed after copy them.
104  *  
105  * Sets data on clipboard to manage them wiht copy, cut and paste operations.
106  * Currently imementation allows #TnyFolder or #TnyHeader objects.
107  *
108  */
109 void modest_email_clipboard_set_data (ModestEmailClipboard *self,
110                                       TnyFolder *src_folder, 
111                                       TnyList *data,
112                                       gboolean delete);
113
114
115 /**
116  * modest_email_clipboard_clear:
117  * @self: a #ModestEmailClipboard singlenton instance.   
118  *  
119  * Clear all data stored inside clipboard.
120  */
121 void modest_email_clipboard_clear (ModestEmailClipboard *self);
122
123
124 /**
125  * modest_email_clipboard_cleared:
126  * @self: a #ModestEmailClipboard singlenton instance.   
127  * 
128  * Determines if clipboard is clreared, no seleciton data is stored.
129  *  
130  * returns TRUE, if clipboard is cleared, FALSE otherwise.
131  */
132 gboolean modest_email_clipboard_cleared (ModestEmailClipboard *self);
133
134
135 /**
136  * modest_email_clipboard_cleared:
137  * @self: a #ModestEmailClipboard singlenton instance.   
138  * @folder: a #TnyFolder instance to compare.
139  * 
140  * Determines if source folder stored on clipboard is the 
141  * same as @folder, passed as argument. 
142  *  
143  * returns TRUE, if clipboard is cleared, FALSE otherwise.
144  */
145 gboolean 
146 modest_email_clipboard_check_source_folder (ModestEmailClipboard *self,
147                                             TnyFolder *folder);
148
149 /**
150  * modest_email_clipboard_set_data:
151  * @self: a #ModestEmailClipboard singlenton instance.   
152  * @n_selected: the number of items copied and marked to delete.
153  * 
154  * Returns the string array of item identifiers stored on clipboard.
155  * 
156  * returns TRUE, if clipboard is cleared, FALSE otherwise.
157  */
158 const gchar **modest_email_clipboard_get_hidding_ids (ModestEmailClipboard *self,
159                                                       guint *n_selected);
160
161 /**
162  * modest_email_clipboard_get_folder_name:
163  * @self: a #ModestEmailClipboard singlenton instance.   
164  * 
165  * Gets the source folder name.
166  * 
167  * returns a const string with folder name, or NULL if data are not valid.
168  */
169 const gchar *modest_email_clipboard_get_folder_name (ModestEmailClipboard *self);
170
171
172 /**
173  * modest_email_clipboard_headers_copied:
174  * @self: a #ModestEmailClipboard singlenton instance.   
175  *
176  * Checks if clipboard has headers stored.
177  * 
178  * returns TRUE, if clipboard stores headers, FALSE otherwise.
179  */
180 gboolean modest_email_clipboard_headers_copied (ModestEmailClipboard *self);
181
182 /**
183  * modest_email_clipboard_headers_copied:
184  * @self: a #ModestEmailClipboard singlenton instance.   
185  *
186  * Checks if clipboard has one folder stored.
187  * 
188  * returns TRUE, if clipboard stores one folder, FALSE otherwise.
189  */
190 gboolean modest_email_clipboard_folder_copied (ModestEmailClipboard *self);
191
192 G_END_DECLS
193
194 #endif /* __MODEST_EMAIL_CLIPBOARD_H__ */