1 | /* ***** BEGIN LICENSE BLOCK *****
|
---|
2 | * Version: CDDL 1.0/LGPL 2.1
|
---|
3 | *
|
---|
4 | * The contents of this file are subject to the COMMON DEVELOPMENT AND
|
---|
5 | * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
|
---|
6 | * this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at http://www.sun.com/cddl/
|
---|
8 | *
|
---|
9 | * Software distributed under the License is distributed on an "AS IS" basis,
|
---|
10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
11 | * for the specific language governing rights and limitations under the
|
---|
12 | * License.
|
---|
13 | *
|
---|
14 | * The Original Code is "NOM" Netlabs Object Model
|
---|
15 | *
|
---|
16 | * The Initial Developer of the Original Code is
|
---|
17 | * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
|
---|
18 | * Portions created by the Initial Developer are Copyright (C) 2005-2007
|
---|
19 | * the Initial Developer. All Rights Reserved.
|
---|
20 | *
|
---|
21 | * Contributor(s):
|
---|
22 | *
|
---|
23 | * Alternatively, the contents of this file may be used under the terms of
|
---|
24 | * the GNU Lesser General Public License Version 2.1 (the "LGPL"), in which
|
---|
25 | * case the provisions of the LGPL are applicable instead of those above. If
|
---|
26 | * you wish to allow use of your version of this file only under the terms of
|
---|
27 | * the LGPL, and not to allow others to use your version of this file under
|
---|
28 | * the terms of the CDDL, indicate your decision by deleting the provisions
|
---|
29 | * above and replace them with the notice and other provisions required by the
|
---|
30 | * LGPL. If you do not delete the provisions above, a recipient may use your
|
---|
31 | * version of this file under the terms of any one of the CDDL or the LGPL.
|
---|
32 | *
|
---|
33 | * ***** END LICENSE BLOCK ***** */
|
---|
34 | /** \file
|
---|
35 |
|
---|
36 | */
|
---|
37 | #ifndef WPFOLDER_IDL_INCLUDED
|
---|
38 | #define WPFOLDER_IDL_INCLUDED
|
---|
39 |
|
---|
40 | #include "nombase.idl"
|
---|
41 |
|
---|
42 | NOMCLASSNAME(WPFolder);
|
---|
43 |
|
---|
44 | #include "wpfilesystem.idl"
|
---|
45 | #include "nomfilepath.idl"
|
---|
46 |
|
---|
47 | NOMMETACLASS(M_WPFolder);
|
---|
48 |
|
---|
49 | /** \interface WPFolder
|
---|
50 |
|
---|
51 | A desktop class representing directories.
|
---|
52 | */
|
---|
53 | interface WPFolder : WPFileSystem
|
---|
54 | {
|
---|
55 | NOMCLASSVERSION(1, 0);
|
---|
56 |
|
---|
57 | /**
|
---|
58 | This method gathers the content of a folder (by searching the filesystem)
|
---|
59 | and creates the objects it contains. This means the representation of the
|
---|
60 | files and folders on disk.
|
---|
61 | All found objects are inserted into the internal list of objects.
|
---|
62 |
|
---|
63 | \remarks This method does not create a folder window nor does it add any
|
---|
64 | objects to the store holding objects to be shown in a folder window.
|
---|
65 |
|
---|
66 | \param fFoldersOnly If set to TRUE only directories are inserted into the
|
---|
67 | content list. This is useful when building tree views.
|
---|
68 |
|
---|
69 | \return TRUE on success FALSE otherwise.
|
---|
70 |
|
---|
71 | */
|
---|
72 | boolean wpPopulate(in unsigned long ulReserved,
|
---|
73 | in string pszPath,
|
---|
74 | in boolean fFoldersOnly);
|
---|
75 |
|
---|
76 | /**
|
---|
77 | Create a window which may show the objects in this folder. The default folder
|
---|
78 | window is just a toplevel window with a container for the icons.
|
---|
79 | This method is called when a new folder view is created. No objects are inserted
|
---|
80 | during execution of this method.
|
---|
81 |
|
---|
82 | \remarks The default window is of class WPFolderWindow. If you want to
|
---|
83 | replace the window make sure you have at least one container window (an
|
---|
84 | icon view) into which objects may be inserted
|
---|
85 |
|
---|
86 | \par How to override:
|
---|
87 | This method may be overriden if the default folder window doesn't fit your
|
---|
88 | needs.
|
---|
89 |
|
---|
90 | \note This method and the WPFolderWindow class need some detailed explanation
|
---|
91 | about subclassing and replacing.
|
---|
92 | */
|
---|
93 | PWPFolderWindow wpCreateFolderWindow();
|
---|
94 |
|
---|
95 | gulong wpQueryFldrFlags();
|
---|
96 | boolean wpSetFldrFlags(in gulong ulFlags, in gulong ulMask);
|
---|
97 |
|
---|
98 | /**
|
---|
99 | Add an object to the internal list of objects held by
|
---|
100 | the folder.
|
---|
101 |
|
---|
102 | \remarks The object is not added to the store which is used
|
---|
103 | for displaying objects in the folder window. It's necessary to call
|
---|
104 | wpAddToStore() for this.
|
---|
105 |
|
---|
106 | \par How to override:
|
---|
107 | This method may be overriden to track the insertion of objects into
|
---|
108 | a folder. The parent should be called first.
|
---|
109 |
|
---|
110 | \param wpObject The object to be added.
|
---|
111 |
|
---|
112 | \return TRUE on success FALSE otherwise.
|
---|
113 |
|
---|
114 | \sa wpQueryContent(), wpDeleteFromContent(), wpAddToStore()
|
---|
115 | */
|
---|
116 | gulong wpAddToContent(in PWPObject wpObject);
|
---|
117 |
|
---|
118 | /**
|
---|
119 | This method needs implementation. The signature will change.
|
---|
120 |
|
---|
121 | Don't use!
|
---|
122 | */
|
---|
123 | PWPObject wpQueryContent();
|
---|
124 |
|
---|
125 | /**
|
---|
126 | Delete an object from the internal list of objects held by
|
---|
127 | the folder.
|
---|
128 |
|
---|
129 | \param wpObject The object to be removed.
|
---|
130 |
|
---|
131 | \return TRUE on success FALSE otherwise.
|
---|
132 |
|
---|
133 | \sa wpQueryContent(), wpAddToContent()
|
---|
134 | */
|
---|
135 | boolean wpDeleteFromContent(in PWPObject wpObject);
|
---|
136 |
|
---|
137 | /**
|
---|
138 | Add an object to the store of the folder. By adding the object
|
---|
139 | to the store it will show in the folder window.
|
---|
140 |
|
---|
141 | \remarks Don't insert an object into the folders store which is not
|
---|
142 | already in the internal list of folder objects. Use wpAddToContent()
|
---|
143 | to do that. If there's no store yet this methods does nothing. A folder
|
---|
144 | only has a store if any view was created.
|
---|
145 |
|
---|
146 | \param wpObject The object to be added to the store. Using NULL here is
|
---|
147 | save and will do nothing.
|
---|
148 |
|
---|
149 | \return TRUE on success FALSE otherwise.
|
---|
150 |
|
---|
151 | \sa wpAddToContent(), wpDeleteFromStore()
|
---|
152 | */
|
---|
153 | PUSEITEM wpAddToStore(in PWPObject wpObject);
|
---|
154 |
|
---|
155 | /**
|
---|
156 | Delete an object from the store. The store holds all the objects which
|
---|
157 | are visible in the folder window.
|
---|
158 |
|
---|
159 | \remarks An object must first be removed from the folders store before it
|
---|
160 | is removed from the folders content list.
|
---|
161 |
|
---|
162 | \param wpObject The object to be removed from the folders store.
|
---|
163 |
|
---|
164 | \sa wpAddToStore(), wpDeleteFromContent()
|
---|
165 | */
|
---|
166 | PUSEITEM wpDeleteFromStore(in PWPObject wpObject);
|
---|
167 |
|
---|
168 | NOMOVERRIDE(wpInitData);
|
---|
169 | /**
|
---|
170 | Override of the wpOpen() method. The WPFolder implementation calls
|
---|
171 | wpPopulate(), creates a new folder window and inserts the objects into the
|
---|
172 | window.
|
---|
173 | */
|
---|
174 | NOMOVERRIDE(wpOpen);
|
---|
175 | NOMOVERRIDE(wpQueryIcon);
|
---|
176 | NOMOVERRIDE(wpQueryDefaultView);
|
---|
177 | NOMOVERRIDE(wpDragOver);
|
---|
178 | NOMOVERRIDE(wpDrop);
|
---|
179 |
|
---|
180 | /**
|
---|
181 | This variable will go away.
|
---|
182 | */
|
---|
183 | NOMINSTANCEVAR(PPRIVFOLDERDATA privFolderData); /* This will go away... */
|
---|
184 | /**
|
---|
185 | This varable holds the binary tree containing all the objects inserted into this
|
---|
186 | folder. The key for accessing the objects is the objects name. This way a fast
|
---|
187 | search for duplicates is possible.
|
---|
188 |
|
---|
189 | \remarks This variable is private and can only be accessed from within the class.
|
---|
190 |
|
---|
191 | \sa wpAddToContent(), wpDeleteFromContent()
|
---|
192 | */
|
---|
193 | NOMINSTANCEVAR(PGTree fldrObjects);
|
---|
194 |
|
---|
195 | /**
|
---|
196 | Container flags.
|
---|
197 |
|
---|
198 | \remarks This variable has access methods for setting and querying.
|
---|
199 |
|
---|
200 | \sa wpQueryFldrFlags(), wpSetFldrFlags(),
|
---|
201 | */
|
---|
202 | NOMINSTANCEVAR(gulong ulFldrFlags);
|
---|
203 | /**
|
---|
204 | This private instance variable holds the store of this folder. The store contains
|
---|
205 | all the objects which are shown in the container.
|
---|
206 |
|
---|
207 | \remarks This variable is private and can only be accessed from within the class.
|
---|
208 |
|
---|
209 | \sa wpAddToStore(), wpDeleteFromStore()
|
---|
210 | */
|
---|
211 | NOMINSTANCEVAR(PGtkListStore pListStore);
|
---|
212 | };
|
---|
213 |
|
---|
214 | #endif /* WPFOLDER_IDL_INCLUDED */
|
---|
215 |
|
---|
216 |
|
---|
217 |
|
---|
218 |
|
---|