claybrowser.h

Go to the documentation of this file.
00001 
00002 /*  $Id: claybrowser.h 355 2005-01-11 22:48:55Z andreradke $    */
00003 
00004 /******************************************************************************
00005 
00006     UserLand Frontier(tm) -- High performance Web content management,
00007     object database, system-level and Internet scripting environment,
00008     including source code editing and debugging.
00009 
00010     Copyright (C) 1992-2004 UserLand Software, Inc.
00011 
00012     This program is free software; you can redistribute it and/or modify
00013     it under the terms of the GNU General Public License as published by
00014     the Free Software Foundation; either version 2 of the License, or
00015     (at your option) any later version.
00016 
00017     This program is distributed in the hope that it will be useful,
00018     but WITHOUT ANY WARRANTY; without even the implied warranty of
00019     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020     GNU General Public License for more details.
00021 
00022     You should have received a copy of the GNU General Public License
00023     along with this program; if not, write to the Free Software
00024     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 
00026 ******************************************************************************/
00027 
00028 #ifndef claybrowserinclude
00029 #define claybrowserinclude
00030 
00031 
00032 #define odbbrowser true
00033 #define filebrowser false
00034              
00035 
00036 /*these macros map our names onto the app0 - app4 bits in each hdlheadrecord*/
00037     
00038     #define flnodeisfolder appbit2
00039     #define flnodeunderlined appbit3
00040     #define flnodeonscrap appbit4
00041     #define tmpbit2 appbit5
00042     #define flnodeneedsbuild appbit6
00043     #define flnewlyinsertednode appbit7
00044 
00045 #if odbbrowser
00046 
00047     #include "db.h"
00048     #include "lang.h"
00049     #include "opinternal.h"
00050     #include "tableformats.h"
00051     
00052     typedef hdldatabaserecord tybrowservol;
00053     
00054     typedef hdlhashtable tybrowserdir;
00055     
00056     typedef struct tybrowserspec {
00057         
00058         tybrowservol vRefNum;
00059         
00060         tybrowserdir parID;
00061         
00062         bigstring name;
00063         } tybrowserspec, *ptrbrowserspec;
00064 
00065 #endif
00066 
00067 #if filebrowser
00068 
00069     #include "file.h"
00070 
00071     typedef short tybrowservol;
00072     
00073     typedef long tybrowserdir;
00074     
00075     typedef FSSpec tybrowserspec, *ptrbrowserspec;
00076 
00077 #endif
00078 
00079 
00080 typedef struct tybrowserinfo { /*one of these is linked into each browser window headrecord*/
00081 
00082     boolean flfolder; /*if true, it's a folder*/
00083     
00084     boolean flvolume; /*if true, it's a volume*/
00085     
00086     tybrowservol vnum; /*the volume on which it's located*/
00087     
00088     tybrowserdir dirid; /*the directory id of the folder that contains it*/
00089 
00090     short suffixnum; /*for duplicate files*/
00091     
00092     unsigned long filesize; /*for files, the size of the file, for folders, the number of files it contains*/
00093     
00094     long timecreated, timemodified; /*the creation/modification date of the file/folder/volume*/
00095     
00096     #if filebrowser
00097     
00098     boolean fllocked: 1; /*if true, the file is locked*/
00099     
00100     boolean flstationery: 1; /*if true, it's a stationery pad*/
00101     
00102     boolean flalias: 1; /*if true, it's an alias file*/
00103     
00104     boolean flejectable: 1; /*if true, it's a volume and it's ejectable*/
00105     
00106     boolean flhardwarelock: 1; /*for volumes, if true, the device is readonly*/
00107     
00108     boolean flremotevolume: 1; /*for volumes, if true, it's a remote volume, accessed over the network*/
00109     
00110     boolean flnamelocked: 1; /*true if the name of this file can't be changed*/
00111     
00112     boolean flcustomicon: 1; /*true if the file has a custom icon in its resource fork*/
00113     
00114     OSType filetype, filecreator; /*identifies the application that created the file*/
00115     
00116     short ixlabel; /*the label of the file, as in the Finder, determines color of icon display*/
00117     
00118     tyfolderview folderview; /*for folders, view-by-name, date, etc.*/
00119     
00120     #endif
00121     } tybrowserinfo;
00122 
00123 
00124 typedef boolean (*tyclayfileloopcallback) (bigstring, tybrowserinfo *, long);
00125 
00126 
00127 boolean browserinitrecord (hdltableformats);
00128 
00129 boolean clayinitializeoutline (void);
00130 
00131 boolean claymakespec (tybrowservol vnum, tybrowserdir dirid, bigstring fname, tybrowserspec *fs);
00132 
00133 boolean claygetfilespec (hdlheadrecord, tybrowserspec *);
00134 
00135 boolean claygetfileinfo (const tybrowserspec *fs, tybrowserinfo *);
00136 
00137 boolean clayfolderloop (const tybrowserspec *, boolean, tyclayfileloopcallback, long);
00138 
00139 boolean clayrenamefile (tybrowserspec *fs, hdlheadrecord headnode); /*6.2b16 AR: headnode instead of bsnew*/
00140 
00141 boolean claygetfilename (const tybrowserspec *pfs, bigstring name);
00142 
00143 boolean browserexpand (hdlheadrecord, long);
00144 
00145 boolean browserselectfile (ptrfilespec, boolean, hdlheadrecord *);
00146 
00147 boolean browserexpandtofile (ptrfilespec);
00148 
00149 boolean browserfollowalias (hdlheadrecord);
00150 
00151 boolean browsernodeexists (hdlheadrecord, const tybrowserspec *);
00152 
00153 boolean browsernewfolder (void);
00154  
00155 boolean browsernewtextfile (void);
00156 
00157 boolean browsernewscript (void);
00158 
00159 boolean browsernewoutline (void);
00160 
00161 boolean browsernewcopy (tybrowserspec *, bigstring);
00162 
00163 boolean browsergetrefcon (hdlheadrecord, tybrowserinfo *);
00164     
00165 boolean browsersetrefcon (hdlheadrecord, tybrowserinfo *);
00166     
00167 boolean browsercopyfileinfo (hdlheadrecord, tybrowserinfo *);
00168 
00169 boolean browseropenmainwindow (void);
00170 
00171 //  boolean browserjumptospecialfolder (tyfoldername);
00172 
00173 boolean browseradjustmenus (void);
00174 
00175 // void browserupdatemsg (const tybrowserspec *, tyfileinfo *);
00176 
00177 boolean browserfileadded (hdlheadrecord, const tybrowserspec *, hdlheadrecord *);
00178 
00179 boolean browserloadnode (hdlheadrecord);
00180 
00181 boolean browserchecklinelength (short, bigstring);
00182 
00183 void browserdrawnodeicon (const Rect *, boolean, hdlheadrecord);
00184 
00185 boolean browsersymbolchanged (hdlhashtable, const bigstring, boolean);
00186 
00187 boolean browsersymbolinserted (hdlhashtable, const bigstring);
00188 
00189 boolean browsersymboldeleted (hdlhashtable, const bigstring);
00190 
00191 void browserupdate (void);
00192 
00193 boolean browserstart (void);
00194 
00195 #endif
00196 

Generated on Wed May 31 18:19:44 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6