2 * Copyright (c) 1996-2013 by the citadel.org team
4 * This program is open source software. You can redistribute it and/or
5 * modify it under the terms of the GNU General Public License, version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
14 #define VIRTUAL_MY_FLOOR -1
17 * This struct holds a list of rooms for "Goto" operations.
20 struct march *next; /* pointer to next in linked list */
21 char march_name[128]; /* name of room */
22 int march_floor; /* floor number of room */
23 int march_order; /* sequence in which we are to visit this room */
27 * This struct holds a list of rooms for client display. It is a binary tree.
30 struct roomlisting *lnext; /* pointer to 'left' tree node */
31 struct roomlisting *rnext; /* pointer to 'right' tree node */
32 char rlname[128]; /* name of room */
33 unsigned rlflags; /* room flags */
34 int rlfloor; /* the floor it resides on */
35 int rlorder; /* room listing order */
42 typedef struct _floor {
50 * Data structure for roomlist-to-folderlist conversion
53 int floor; /* which floor is it on */
54 char room[SIZ]; /* which roomname ??? */
55 char name[SIZ]; /* which is its own name??? */
56 int hasnewmsgs; /* are there unread messages inside */
57 int is_mailbox; /* is it a mailbox? */
58 int selectable; /* can we select it ??? */
59 int view; /* whats its default view? inbox/calendar.... */
60 int num_rooms; /* If this is a floor, how many rooms does it have */
66 * Data structure for roomlist-to-folderlist conversion
68 typedef struct _folder {
69 /* Data citserver tells us about the room */
70 long QRFlags; /* roomflags */
71 long QRFlags2; /* Bitbucket NO2 */
74 int view; /* whats its default view? inbox/calendar.... */
76 long lastchange; /* todo... */
78 /* later evaluated data from the serverdata */
79 StrBuf *name; /* the full name of the room we're talking about */
81 StrBuf **RoomNameParts;
83 int floorid; /* which floor is it on */
84 const Floor *Floor; /* point to the floor we're on.. */
86 int hasnewmsgs; /* are there unread messages inside */
87 int is_inbox; /* is it a mailbox? */
92 /* only available if GNET contains this */
93 const StrBuf* RoomAlias; /* by what mail will this room send mail? */
95 /* only available if GETR was run */
101 /* Only available from the GOTO context... */
104 long LastMessageRead;
108 /* Only available if certain other commands ran */
110 int XHaveRoomPicLoaded;
112 int XHaveInfoTextLoaded;
115 int XHaveDownloadCount;
118 int BumpUsers; /* if SETR set to 1 to make all users who knew this room to forget about it. */
120 HashList *IgnetCfgs[maxRoomNetCfg + 1];
123 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
124 void vDeleteFolder(void *vFolder);
125 void FlushFolder(folder *room);
126 void FlushIgnetCfgs(folder *room);
127 void ParseGoto(folder *proom, StrBuf *Line);
128 void FlushRoomlist(void); /* release our caches, so a deleted / zapped room disapears */
129 void ReloadCurrentRoom(void); /* Flush cache; reload current state */
131 HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
132 HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
133 int SortRoomsByListOrder(const void *room1, const void *room2);
134 void tmplput_roombanner(StrBuf *Target, WCTemplputParams *TP);
137 void LoadRoomAide(void);
138 void LoadRoomXA (void);
139 void LoadXRoomPic(void);
140 void LoadXRoomInfoText(void);
141 void LoadXRoomXCountFiles(void);
143 long gotoroom(const StrBuf *gname);
145 void slrp_highest(void);
146 void remove_march(const StrBuf *aaa);
148 void smart_goto(const StrBuf *next_room);
149 void free_march_list(wcsession *wcf);
152 * wrapper around usual sort-comparator; private rooms will allways be prefered, -1 if one of them NULL
154 int CompareRooms(const folder *room1, const folder *room2);
157 #define REST_TOPLEVEL 0
158 #define REST_IN_NAMESPACE (1<<0)
159 #define REST_IN_FLOOR (1<<1)
160 #define REST_IN_ROOM (1<<2)
161 #define REST_HAVE_SUB_ROOMS (1<<3)
162 #define REST_GOT_LOCAL_PART (1<<4)
163 #define REST_NONEXIST (1<<5)
166 extern CtxType CTX_ROOMS;
167 extern CtxType CTX_FLOORS;