2009-01-31 07:53:36 +01:00
|
|
|
/*
|
2010-02-28 01:08:10 +01:00
|
|
|
* This file is a part of Winix
|
2009-01-31 07:53:36 +01:00
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2012-01-21 13:29:44 +01:00
|
|
|
* Copyright (c) 2008-2012, Tomasz Sowa
|
2009-01-31 07:53:36 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2011-02-16 00:20:12 +01:00
|
|
|
#ifndef headerfile_winix_core_pluginmsg
|
|
|
|
#define headerfile_winix_core_pluginmsg
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2012-03-17 06:11:23 +01:00
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
// here you can add your own EZC functions ([function])
|
|
|
|
// PluginInfo.p1 is a pointer to Ezc::Functions object
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2010-02-11 21:56:52 +01:00
|
|
|
#define WINIX_TEMPLATES_CREATEFUNCTIONS 999
|
2010-07-27 22:41:56 +02:00
|
|
|
|
2010-12-06 01:25:46 +01:00
|
|
|
// here you can add your own EZC functions to notify system
|
|
|
|
// warning: this functions will be called from an other thread
|
|
|
|
// so you should use synchro->Lock() and synchro->Unlock()
|
|
|
|
// when attempting to winix objects
|
|
|
|
// PluginInfo.p1 is a pointer to Ezc::Functions object
|
|
|
|
// which is defined as:
|
|
|
|
// Ezc::Functions<NotifyStream> ezc_functions;
|
|
|
|
// and Notify Stream is:
|
|
|
|
// typedef TextStream<std::wstring> NotifyStream;
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2010-12-06 01:25:46 +01:00
|
|
|
#define WINIX_NOTIFY_TEMPLATES_CREATEFUNCTIONS 998
|
|
|
|
|
2010-10-24 01:51:44 +02:00
|
|
|
// winix function and parameters have been parsed
|
|
|
|
// the request.status is OK
|
|
|
|
// (the winix function was not called yet)
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_PREPARE_REQUEST 20000
|
2010-10-24 01:51:44 +02:00
|
|
|
|
|
|
|
// post and get functions have done their jobs
|
|
|
|
// now you can act
|
|
|
|
// this is called only if the request.status is OK
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_PROCESS_REQUEST 20010
|
2010-10-24 01:51:44 +02:00
|
|
|
|
|
|
|
// prepere your content for displaying
|
|
|
|
// this is called after WINIX_PROCESS_REQUEST
|
|
|
|
// and when there is not a redirect
|
|
|
|
// request.status is not checked here
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_CONTENT_MAKE 20020
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2010-05-04 23:58:22 +02:00
|
|
|
// here you can attach your own session data (based on PluginDataBase class)
|
2011-10-16 23:33:45 +02:00
|
|
|
// call cur->session->plugin_data.Assign(pointer)
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_SESSION_CREATED 30000
|
2010-05-04 23:58:22 +02:00
|
|
|
|
|
|
|
// here you should remove your session data
|
2012-01-21 13:29:44 +01:00
|
|
|
// this message can be sent even if you don't assing your plugin data
|
2012-03-17 06:11:23 +01:00
|
|
|
#define WINIX_PLUGIN_SESSION_DATA_REMOVE 30010
|
2010-05-04 23:58:22 +02:00
|
|
|
|
|
|
|
// when a session is changed (you can save a pointer to your data here)
|
2012-03-17 06:11:23 +01:00
|
|
|
// 'session changed' means that there is a new request
|
|
|
|
// !! IMPROVE ME it has to be changed to a better name
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_SESSION_CHANGED 30020
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2012-03-17 06:11:23 +01:00
|
|
|
// a session has changed its id
|
|
|
|
// it is typically when you are logging in
|
|
|
|
// 'login' winix function will change the session id (for security reasons)
|
|
|
|
// in l1 you have the old id, in l2 you have the new id
|
|
|
|
#define WINIX_SESSION_CHANGED_ID 30025
|
|
|
|
|
2012-05-01 19:58:42 +02:00
|
|
|
// a session is going to be removed
|
|
|
|
// it is called from session manager's thread (with lock/unlock)
|
|
|
|
#define WINIX_PREPARE_SESSION_TO_REMOVE 30027
|
|
|
|
|
|
|
|
// a session has been removed
|
|
|
|
// it is called from session manager's thread (with lock/unlock)
|
|
|
|
// in l1 you have the old session id
|
|
|
|
#define WINIX_SESSION_REMOVED 30029
|
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
// the winix is closing
|
2012-03-09 23:56:54 +01:00
|
|
|
// there is not any sessions available (cur->session is null)
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_CLOSE 30040
|
|
|
|
|
|
|
|
// preparing to remove a file (rm function)
|
|
|
|
// in p1 you have a pointer to the Item struct (file)
|
|
|
|
// valid members are:
|
|
|
|
// id, parent_id, type, url, file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size
|
|
|
|
// user_id, group_id, privileges
|
|
|
|
// (sometimes rest members can be valid as well -- when you call directly fun_rm->RemoveFileOrSymlink() method)
|
|
|
|
#define WINIX_FILE_PREPARE_TO_REMOVE 30045
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2011-01-24 00:23:24 +01:00
|
|
|
// a file or symlink was removed (rm function)
|
2011-09-30 03:33:42 +02:00
|
|
|
// in p1 you have a pointer to the Item struct (old file)
|
2012-01-25 00:03:36 +01:00
|
|
|
// valid members are the same as in WINIX_FILE_PREPARE_TO_REMOVE
|
|
|
|
#define WINIX_FILE_REMOVED 30050
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2010-07-27 22:41:56 +02:00
|
|
|
// preparing to remove a directory (rm function)
|
2011-09-30 03:33:42 +02:00
|
|
|
// in p1 you have a pointer to the Item struct (directory)
|
2012-01-25 00:03:36 +01:00
|
|
|
// this message is sent after checking the directory permissions
|
|
|
|
// so consequently if there is no any database error then the
|
|
|
|
// directory will be removed
|
|
|
|
// and after removed WINIX_DIR_REMOVED message is sent
|
|
|
|
#define WINIX_DIR_PREPARE_TO_REMOVE 30070
|
|
|
|
|
|
|
|
// directory was removed (rm function)
|
|
|
|
// PluginInfo::l1 is the directory id
|
|
|
|
#define WINIX_DIR_REMOVED 30060
|
2009-11-13 21:40:11 +01:00
|
|
|
|
2010-08-14 18:23:18 +02:00
|
|
|
// winix is initialized,
|
|
|
|
// now you can initialize your plugin
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_PLUGIN_INIT 30080
|
2010-08-14 18:23:18 +02:00
|
|
|
|
2010-09-13 01:33:27 +02:00
|
|
|
// here you can add your own mount point, file systems, mount parameters
|
|
|
|
// for adding a new mount type call: system->mounts.AddMountType("new_mount_name")
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_ADD_MOUNTS 30090
|
2009-01-26 21:49:28 +01:00
|
|
|
|
2011-09-17 00:46:42 +02:00
|
|
|
// add plugin functions (winix functions) here
|
|
|
|
// call info.functions->Add() to add a function
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_CREATE_FUNCTIONS 30100
|
2010-09-29 23:24:34 +02:00
|
|
|
|
|
|
|
// choose a default function
|
|
|
|
// if you do not select it then it will be choosen by winix
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_SELECT_DEFAULT_FUNCTION 30110
|
2010-09-29 23:24:34 +02:00
|
|
|
|
2010-10-11 22:42:49 +02:00
|
|
|
// /etc/fstab has been changed
|
|
|
|
// now we have new mount points
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_FSTAB_CHANGED 30120
|
2010-10-11 22:42:49 +02:00
|
|
|
|
2010-12-06 01:25:46 +01:00
|
|
|
// here you add your own template to notification system
|
|
|
|
// call system->notify.AddTemplate() method
|
|
|
|
// with a template file name
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_NOTIFY_ADD_TEMPLATE 30130
|
2010-10-11 22:42:49 +02:00
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
// the request is being ended
|
2011-10-16 23:33:45 +02:00
|
|
|
// you can clear some of your objects here
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_END_REQUEST 30140
|
2011-01-20 19:37:51 +01:00
|
|
|
|
2011-07-29 00:18:10 +02:00
|
|
|
// a new file (page) has been added
|
|
|
|
// in p1 you have a pointer to the Item struct
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_FILE_ADDED 30150
|
2011-07-29 00:18:10 +02:00
|
|
|
|
|
|
|
// a file (page) has been changed (edited)
|
|
|
|
// in p1 you have a pointer to the Item struct
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_FILE_CHANGED 30160
|
2011-07-29 00:18:10 +02:00
|
|
|
|
2012-02-24 13:09:38 +01:00
|
|
|
// a new directory has been added
|
|
|
|
// in p1 you have a pointer to the Item struct
|
|
|
|
#define WINIX_DIR_ADDED 30155
|
|
|
|
|
2011-09-13 08:08:34 +02:00
|
|
|
// a file (page) has been copied
|
|
|
|
// in p1 you have a pointer to the Item struct
|
|
|
|
// not every fields of Item struct are filled
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_FILE_COPIED 30170
|
2011-09-13 08:08:34 +02:00
|
|
|
|
|
|
|
// a file will be moved
|
|
|
|
// in p1 you have a pointer to the Item struct
|
2012-01-25 00:03:36 +01:00
|
|
|
// valid members are:
|
|
|
|
// id, parent_id, type, url, file_path, file_fs, file_type, has_thumb, hash, hash_type, file_size
|
|
|
|
// user_id, group_id, privileges, meta
|
|
|
|
// (sometimes rest members can be valid as well -- when you call directly fun_rm->RemoveFileOrSymlink() method)
|
|
|
|
#define WINIX_FILE_PREPARE_TO_MOVE 30180
|
2011-09-13 08:08:34 +02:00
|
|
|
|
|
|
|
// a file has been moved
|
|
|
|
// in p1 you have a pointer to the Item struct (new file)
|
2012-01-25 00:03:36 +01:00
|
|
|
// valid members are the same as in WINIX_FILE_PREPARE_TO_MOVE
|
|
|
|
#define WINIX_FILE_MOVED 30190
|
2011-09-13 08:08:34 +02:00
|
|
|
|
|
|
|
// a thumbnail was created
|
|
|
|
// this message is called from another thread
|
2012-03-17 06:11:23 +01:00
|
|
|
// the thread called Lock() before sending this message
|
2011-09-13 08:08:34 +02:00
|
|
|
// in p1 you have a pointer to the Item struct
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_CREATED_THUMB 30500
|
2011-09-13 08:08:34 +02:00
|
|
|
|
|
|
|
// an image has been resized
|
|
|
|
// this message is called from another thread
|
2012-03-17 06:11:23 +01:00
|
|
|
// the thread called Lock() before sending this message
|
2011-09-13 08:08:34 +02:00
|
|
|
// in p1 you have a pointer to the Item struct
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_IMAGE_RESIZED 30520
|
2011-09-13 08:08:34 +02:00
|
|
|
|
|
|
|
// content of a directory was sorted
|
|
|
|
// (winix 'sort' function was used)
|
|
|
|
// in p1 you have a pointer to the Item struct (of the directory)
|
|
|
|
// this is from system->dirs so you should not change the item
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_DIR_CONTENT_SORTED 30500
|
2011-09-13 08:08:34 +02:00
|
|
|
|
2012-03-14 21:25:30 +01:00
|
|
|
// a user will be logged in
|
|
|
|
// set PluginInfo::res to false (it is by default) to prevent logging the user
|
|
|
|
// directly after this message (if you do not return false)
|
|
|
|
// a WINIX_USER_LOGGED is sent
|
|
|
|
// in p1 you have a pointer to User struct
|
|
|
|
// (if at least one plugin returns false then the user will not be logged)
|
2012-03-17 06:11:23 +01:00
|
|
|
// this message is not sent when winix starts and sessions are read from a sessions file
|
|
|
|
// in such a case only WINIX_USER_LOGGED will be sent
|
2012-03-14 21:25:30 +01:00
|
|
|
#define WINIX_PREPARE_USER_TO_LOGIN 30550
|
|
|
|
|
2011-10-16 23:33:45 +02:00
|
|
|
// a user has been logged
|
|
|
|
// send from 'login' winix function
|
|
|
|
// this message is also called when winix starts and reads sessions
|
|
|
|
// from the session file
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_USER_LOGGED 30600
|
2011-10-16 23:33:45 +02:00
|
|
|
|
2012-03-09 03:36:25 +01:00
|
|
|
// a user is going to logout
|
|
|
|
// in p1 you have a pointer to User struct
|
2012-03-17 06:11:23 +01:00
|
|
|
// the message is also sent from the session GC (special thread for deleting sessions)
|
|
|
|
// in such a case is sent with Lock() and Unlock()
|
|
|
|
// so *don't* use Lock() in your procedure
|
2012-03-09 03:36:25 +01:00
|
|
|
#define WINIX_PREPARE_USER_TO_LOGOUT 30610
|
2011-09-13 08:08:34 +02:00
|
|
|
|
2011-08-27 05:12:33 +02:00
|
|
|
// here you add your own html templates
|
|
|
|
// call TemplatesFunctions::patterns.Add(L"file_name.html")
|
|
|
|
// the method returns an index which you have to remember
|
|
|
|
// and you can get the template with patterns.Get(index, lang_index)
|
|
|
|
// it returns a pointer to Ezc::Pattern (or null pointer if the index is wrong)
|
|
|
|
// the message will be sent too whenever 'reload/templates' winix function is called
|
|
|
|
// templates you should add only in this message
|
|
|
|
// in other cases after 'reload' function the indexes would be wrong
|
2012-03-17 06:11:23 +01:00
|
|
|
// session pointer is null
|
2012-01-25 00:03:36 +01:00
|
|
|
#define WINIX_ADD_TEMPLATE 31000
|
2011-07-29 00:18:10 +02:00
|
|
|
|
2012-03-09 03:36:25 +01:00
|
|
|
// a user will be removed
|
|
|
|
// in p1 you have a pointer to the User struct
|
|
|
|
// directly after this message a WINIX_USER_REMOVED will be sent
|
|
|
|
#define WINIX_PREPARE_TO_REMOVE_USER 31010
|
|
|
|
|
|
|
|
// a user has been removed
|
|
|
|
// in l1 you have the old user_id
|
|
|
|
#define WINIX_USER_REMOVED 31020
|
|
|
|
|
2012-04-22 15:30:07 +02:00
|
|
|
// here you can check if the domain part of the URL address is correct
|
|
|
|
// if no then set cur-request->redirect_to
|
|
|
|
// and winix will do a 'base url redirect' without making any winix functions
|
|
|
|
// the session pointer in info is null
|
|
|
|
#define WINIX_BASE_URL_REDIRECT 31030
|
2011-07-29 00:18:10 +02:00
|
|
|
|
|
|
|
|
2012-04-26 00:24:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
messages sent from other threads
|
|
|
|
!! IMPROVE ME check if some above messages should be moved here
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// a job has to be done
|
|
|
|
// this is sent from the other thread (without locking)
|
|
|
|
// in p1 you have a pointer to PT::Space
|
|
|
|
// session is null
|
|
|
|
#define WINIX_JOB 31200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-01-20 19:37:51 +01:00
|
|
|
// values from 4000 - 4099 reserved for 'thread' plugin
|
|
|
|
// see plugins/thread/pluginmsg.h
|
|
|
|
|
|
|
|
// values from 4100 - 4199 reserved for 'ticket' plugin
|
|
|
|
// see plugins/ticket/pluginmsg.h
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-01-26 21:49:28 +01:00
|
|
|
#endif
|