/* * This file is a part of Winix * and is not publicly distributed * * Copyright (c) 2008-2012, Tomasz Sowa * All rights reserved. * */ #ifndef headerfile_winix_core_pluginmsg #define headerfile_winix_core_pluginmsg // here you can add your own EZC functions ([function]) // PluginInfo.p1 is a pointer to Ezc::Functions object // session pointer is null #define WINIX_TEMPLATES_CREATEFUNCTIONS 999 // 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 ezc_functions; // and Notify Stream is: // typedef TextStream NotifyStream; // session pointer is null #define WINIX_NOTIFY_TEMPLATES_CREATEFUNCTIONS 998 // winix function and parameters have been parsed // the request.status is OK // (the winix function was not called yet) #define WINIX_PREPARE_REQUEST 20000 // post and get functions have done their jobs // now you can act // this is called only if the request.status is OK #define WINIX_PROCESS_REQUEST 20010 // 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 #define WINIX_CONTENT_MAKE 20020 // here you can attach your own session data (based on PluginDataBase class) // call cur->session->plugin_data.Assign(pointer) #define WINIX_SESSION_CREATED 30000 // here you should remove your session data // this message can be sent even if you don't assing your plugin data #define WINIX_PLUGIN_SESSION_DATA_REMOVE 30010 // when a session is changed (you can save a pointer to your data here) // 'session changed' means that there is a new request // !! IMPROVE ME it has to be changed to a better name #define WINIX_SESSION_CHANGED 30020 // 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 // the winix is closing // there is not any sessions available (cur->session is null) // session pointer is null #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 // a file or symlink was removed (rm function) // in p1 you have a pointer to the Item struct (old file) // valid members are the same as in WINIX_FILE_PREPARE_TO_REMOVE #define WINIX_FILE_REMOVED 30050 // preparing to remove a directory (rm function) // in p1 you have a pointer to the Item struct (directory) // 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 // winix is initialized, // now you can initialize your plugin // session pointer is null #define WINIX_PLUGIN_INIT 30080 // 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") // session pointer is null #define WINIX_ADD_MOUNTS 30090 // add plugin functions (winix functions) here // call info.functions->Add() to add a function // session pointer is null #define WINIX_CREATE_FUNCTIONS 30100 // choose a default function // if you do not select it then it will be choosen by winix #define WINIX_SELECT_DEFAULT_FUNCTION 30110 // /etc/fstab has been changed // now we have new mount points // session pointer is null #define WINIX_FSTAB_CHANGED 30120 // here you add your own template to notification system // call system->notify.AddTemplate() method // with a template file name // session pointer is null #define WINIX_NOTIFY_ADD_TEMPLATE 30130 // the request is being ended // you can clear some of your objects here #define WINIX_END_REQUEST 30140 // a new file (page) has been added // in p1 you have a pointer to the Item struct #define WINIX_FILE_ADDED 30150 // a file (page) has been changed (edited) // in p1 you have a pointer to the Item struct #define WINIX_FILE_CHANGED 30160 // a new directory has been added // in p1 you have a pointer to the Item struct #define WINIX_DIR_ADDED 30155 // a file (page) has been copied // in p1 you have a pointer to the Item struct // not every fields of Item struct are filled #define WINIX_FILE_COPIED 30170 // a file will be moved // in p1 you have a pointer to the Item struct // 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 // a file has been moved // in p1 you have a pointer to the Item struct (new file) // valid members are the same as in WINIX_FILE_PREPARE_TO_MOVE #define WINIX_FILE_MOVED 30190 // a thumbnail was created // this message is called from another thread // the thread called Lock() before sending this message // in p1 you have a pointer to the Item struct // session pointer is null #define WINIX_CREATED_THUMB 30500 // an image has been resized // this message is called from another thread // the thread called Lock() before sending this message // in p1 you have a pointer to the Item struct // session pointer is null #define WINIX_IMAGE_RESIZED 30520 // 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 #define WINIX_DIR_CONTENT_SORTED 30500 // 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) // 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 #define WINIX_PREPARE_USER_TO_LOGIN 30550 // 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 #define WINIX_USER_LOGGED 30600 // a user is going to logout // in p1 you have a pointer to User struct // 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 #define WINIX_PREPARE_USER_TO_LOGOUT 30610 // 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 // session pointer is null #define WINIX_ADD_TEMPLATE 31000 // 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 // 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 // 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 #endif