| 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 | #ifdef __NOM_IDL_COMPILER__
|
|---|
| 56 | metaclass=M_WPFolder;
|
|---|
| 57 | filestem=wpfolder;
|
|---|
| 58 | #endif
|
|---|
| 59 | NOMCLASSVERSION(1, 0);
|
|---|
| 60 |
|
|---|
| 61 | /**
|
|---|
| 62 | This method gathers the content of a folder (by searching the filesystem)
|
|---|
| 63 | and creates the objects it contains. This means the representation of the
|
|---|
| 64 | files and folders on disk.
|
|---|
| 65 | All found objects are inserted into the internal list of objects.
|
|---|
| 66 |
|
|---|
| 67 | \remarks This method does not create a folder window nor does it add any
|
|---|
| 68 | objects to the store holding objects to be shown in a folder window.
|
|---|
| 69 |
|
|---|
| 70 | \param fFoldersOnly If set to TRUE only directories are inserted into the
|
|---|
| 71 | content list. This is useful when building tree views.
|
|---|
| 72 |
|
|---|
| 73 | \return TRUE on success FALSE otherwise.
|
|---|
| 74 |
|
|---|
| 75 | */
|
|---|
| 76 | boolean wpPopulate(in unsigned long ulReserved,
|
|---|
| 77 | in string pszPath,
|
|---|
| 78 | in boolean fFoldersOnly);
|
|---|
| 79 |
|
|---|
| 80 | /**
|
|---|
| 81 | Create a window which may show the objects in this folder. The default folder
|
|---|
| 82 | window is just a toplevel window with a container for the icons.
|
|---|
| 83 | This method is called when a new folder view is created. No objects are inserted
|
|---|
| 84 | during execution of this method.
|
|---|
| 85 |
|
|---|
| 86 | \remarks The default window is of class WPFolderWindow. If you want to
|
|---|
| 87 | replace the window make sure you have at least one container window (an
|
|---|
| 88 | icon view) into which objects may be inserted
|
|---|
| 89 |
|
|---|
| 90 | \par How to override:
|
|---|
| 91 | This method may be overriden if the default folder window doesn't fit your
|
|---|
| 92 | needs.
|
|---|
| 93 |
|
|---|
| 94 | \note This method and the WPFolderWindow class need some detailed explanation
|
|---|
| 95 | about subclassing and replacing.
|
|---|
| 96 | */
|
|---|
| 97 | PWPFolderWindow wpCreateFolderWindow();
|
|---|
| 98 |
|
|---|
| 99 | gulong wpQueryFldrFlags();
|
|---|
| 100 | boolean wpSetFldrFlags(in gulong ulFlags, in gulong ulMask);
|
|---|
| 101 | // NOMPARMCHECK(wpSetFldrFlags, FALSE, !=0);
|
|---|
| 102 | /**
|
|---|
| 103 | Add an object to the internal list of objects held by
|
|---|
| 104 | the folder.
|
|---|
| 105 |
|
|---|
| 106 | \remarks The object is not added to the store which is used
|
|---|
| 107 | for displaying objects in the folder window. It's necessary to call
|
|---|
| 108 | wpAddToStore() for this.
|
|---|
| 109 |
|
|---|
| 110 | \par How to override:
|
|---|
| 111 | This method may be overriden to track the insertion of objects into
|
|---|
| 112 | a folder. The parent should be called first.
|
|---|
| 113 |
|
|---|
| 114 | \param wpObject The object to be added.
|
|---|
| 115 |
|
|---|
| 116 | \return TRUE on success FALSE otherwise.
|
|---|
| 117 |
|
|---|
| 118 | \sa wpQueryContent(), wpDeleteFromContent(), wpAddToStore()
|
|---|
| 119 | */
|
|---|
| 120 | gulong wpAddToContent(in PWPObject wpObject);
|
|---|
| 121 |
|
|---|
| 122 | /**
|
|---|
| 123 | This method needs implementation. The signature will change.
|
|---|
| 124 |
|
|---|
| 125 | Don't use!
|
|---|
| 126 | */
|
|---|
| 127 | PWPObject wpQueryContent();
|
|---|
| 128 |
|
|---|
| 129 | /**
|
|---|
| 130 | Delete an object from the internal list of objects held by
|
|---|
| 131 | the folder.
|
|---|
| 132 |
|
|---|
| 133 | \param wpObject The object to be removed.
|
|---|
| 134 |
|
|---|
| 135 | \return TRUE on success FALSE otherwise.
|
|---|
| 136 |
|
|---|
| 137 | \sa wpQueryContent(), wpAddToContent()
|
|---|
| 138 | */
|
|---|
| 139 | boolean wpDeleteFromContent(in PWPObject wpObject);
|
|---|
| 140 |
|
|---|
| 141 | /**
|
|---|
| 142 | Add an object to the store of the folder. By adding the object
|
|---|
| 143 | to the store it will show in the folder window.
|
|---|
| 144 |
|
|---|
| 145 | \remarks Don't insert an object into the folders store which is not
|
|---|
| 146 | already in the internal list of folder objects. Use wpAddToContent()
|
|---|
| 147 | to do that. If there's no store yet this methods does nothing. A folder
|
|---|
| 148 | only has a store if any view was created.
|
|---|
| 149 |
|
|---|
| 150 | \param wpObject The object to be added to the store. Using NULL here is
|
|---|
| 151 | save and will do nothing.
|
|---|
| 152 |
|
|---|
| 153 | \return TRUE on success FALSE otherwise.
|
|---|
| 154 |
|
|---|
| 155 | \sa wpAddToContent(), wpDeleteFromStore()
|
|---|
| 156 | */
|
|---|
| 157 | PUSEITEM wpAddToStore(in PWPObject wpObject);
|
|---|
| 158 |
|
|---|
| 159 | /**
|
|---|
| 160 | Delete an object from the store. The store holds all the objects which
|
|---|
| 161 | are visible in the folder window.
|
|---|
| 162 |
|
|---|
| 163 | \remarks An object must first be removed from the folders store before it
|
|---|
| 164 | is removed from the folders content list.
|
|---|
| 165 |
|
|---|
| 166 | \param wpObject The object to be removed from the folders store.
|
|---|
| 167 |
|
|---|
| 168 | \sa wpAddToStore(), wpDeleteFromContent()
|
|---|
| 169 | */
|
|---|
| 170 | PUSEITEM wpDeleteFromStore(in PWPObject wpObject);
|
|---|
| 171 |
|
|---|
| 172 | NOMOVERRIDE(wpInitData);
|
|---|
| 173 | /**
|
|---|
| 174 | Override of the wpOpen() method. The WPFolder implementation calls
|
|---|
| 175 | wpPopulate(), creates a new folder window and inserts the objects into the
|
|---|
| 176 | window.
|
|---|
| 177 | */
|
|---|
| 178 | NOMOVERRIDE(wpOpen);
|
|---|
| 179 | NOMOVERRIDE(wpQueryIcon);
|
|---|
| 180 | NOMOVERRIDE(wpQueryDefaultView);
|
|---|
| 181 | NOMOVERRIDE(wpDragOver);
|
|---|
| 182 | NOMOVERRIDE(wpDrop);
|
|---|
| 183 |
|
|---|
| 184 | /**
|
|---|
| 185 | This variable will go away.
|
|---|
| 186 | */
|
|---|
| 187 | NOMINSTANCEVAR(PPRIVFOLDERDATA privFolderData); /* This will go away... */
|
|---|
| 188 | /**
|
|---|
| 189 | This varable holds the binary tree containing all the objects inserted into this
|
|---|
| 190 | folder. The key for accessing the objects is the objects name. This way a fast
|
|---|
| 191 | search for duplicates is possible.
|
|---|
| 192 |
|
|---|
| 193 | \remarks This variable is private and can only be accessed from within the class.
|
|---|
| 194 |
|
|---|
| 195 | \sa wpAddToContent(), wpDeleteFromContent()
|
|---|
| 196 | */
|
|---|
| 197 | NOMINSTANCEVAR(PGTree fldrObjects);
|
|---|
| 198 |
|
|---|
| 199 | /**
|
|---|
| 200 | Container flags.
|
|---|
| 201 |
|
|---|
| 202 | \remarks This variable has access methods for setting and querying.
|
|---|
| 203 |
|
|---|
| 204 | \sa wpQueryFldrFlags(), wpSetFldrFlags(),
|
|---|
| 205 | */
|
|---|
| 206 | NOMINSTANCEVAR(gulong ulFldrFlags);
|
|---|
| 207 | /**
|
|---|
| 208 | This private instance variable holds the store of this folder. The store contains
|
|---|
| 209 | all the objects which are shown in the container.
|
|---|
| 210 |
|
|---|
| 211 | \remarks This variable is private and can only be accessed from within the class.
|
|---|
| 212 |
|
|---|
| 213 | \sa wpAddToStore(), wpDeleteFromStore()
|
|---|
| 214 | */
|
|---|
| 215 | NOMINSTANCEVAR(PGtkListStore pListStore);
|
|---|
| 216 | };
|
|---|
| 217 |
|
|---|
| 218 | #endif /* WPFOLDER_IDL_INCLUDED */
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|