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