diff options
author | Mattes D <github@xoft.cz> | 2016-03-02 10:05:10 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-03-17 19:29:01 +0100 |
commit | 62d81eb763e6fb72af5d828c1892156e1f5a3127 (patch) | |
tree | 7c04181f9f1f21dbe6a5ef00d5fed53c1baa8a54 /src/Bindings/WebPlugin.h | |
parent | Added cLuaState::cCallback for representing (resettable) Lua callbacks. (diff) | |
download | cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar.gz cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar.bz2 cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar.lz cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar.xz cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.tar.zst cuberite-62d81eb763e6fb72af5d828c1892156e1f5a3127.zip |
Diffstat (limited to 'src/Bindings/WebPlugin.h')
-rw-r--r-- | src/Bindings/WebPlugin.h | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/Bindings/WebPlugin.h b/src/Bindings/WebPlugin.h deleted file mode 100644 index 6dc8db801..000000000 --- a/src/Bindings/WebPlugin.h +++ /dev/null @@ -1,80 +0,0 @@ - -#pragma once - -struct HTTPRequest; - - - - - -// tolua_begin -class cWebPlugin -{ -public: - // tolua_end - - struct cTab - { - AString m_Title; - AString m_SafeTitle; - int m_UserData; - - cTab(const AString & a_Title, int a_UserData): - m_Title(a_Title), - m_SafeTitle(cWebPlugin::SafeString(a_Title)), - m_UserData(a_UserData) - { - } - }; - - typedef SharedPtr<cTab> cTabPtr; - typedef std::list<cTabPtr> cTabPtrs; - typedef std::list<std::pair<AString, AString>> cTabNames; - - - cWebPlugin(); - - virtual ~cWebPlugin(); - - // tolua_begin - - /** Returns the title of the plugin, as it should be presented in the webadmin's pages tree. */ - virtual const AString GetWebTitle(void) const = 0; - - /** Sanitizes the input string, replacing spaces with underscores. */ - static AString SafeString(const AString & a_String); - - // tolua_end - - virtual AString HandleWebRequest(const HTTPRequest & a_Request) = 0; - - /** Adds a new web tab with the specified contents. */ - void AddNewWebTab(const AString & a_Title, int a_UserData); - - /** Removes all the tabs. */ - void ClearTabs(void); - - /** Returns all the tabs that this plugin has registered. */ - const cTabPtrs & GetTabs(void) const { return m_Tabs; } - - /** Returns all of the tabs that this plugin has registered. */ - cTabNames GetTabNames(void) const; // Exported in ManualBindings.cpp - - /** Returns the tab that has the specified SafeTitle. - Returns nullptr if no such tab. */ - cTabPtr GetTabBySafeTitle(const AString & a_SafeTitle) const; - - std::pair<AString, AString> GetTabNameForRequest(const HTTPRequest & a_Request); - -private: - /** All tabs that this plugin has registered. - Protected against multithreaded access by m_CSTabs. */ - cTabPtrs m_Tabs; - - /** Protects m_Tabs against multithreaded access. */ - mutable cCriticalSection m_CSTabs; -}; // tolua_export - - - - |