ISystem: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
class ISystem : public IBaseInterface | class ISystem : public IBaseInterface | ||
{ | { | ||
public: | public: | ||
// use this with the "open" command to launch web browsers/explorer windows, eg. ShellExecute("open", "www.valvesoftware.com") | // use this with the "open" command to launch web browsers/explorer windows, eg. ShellExecute("open", "www.valvesoftware.com") | ||
virtual void ShellExecute(const char *command, const char *file) = 0; | virtual void [[ShellExecute]](const char *command, const char *file) = 0; | ||
// returns the time at the start of the frame, in seconds | // returns the time at the start of the frame, in seconds | ||
virtual double GetFrameTime() = 0; | virtual double [[GetFrameTime]]() = 0; | ||
// returns the current time, in seconds | // returns the current time, in seconds | ||
virtual double GetCurrentTime() = 0; | virtual double [[GetCurrentTime]]() = 0; | ||
// returns the current time, in milliseconds | // returns the current time, in milliseconds | ||
virtual long GetTimeMillis() = 0; | virtual long [[GetTimeMillis]]() = 0; | ||
// clipboard access | // clipboard access | ||
virtual int GetClipboardTextCount() = 0; | virtual int [[GetClipboardTextCount]]() = 0; | ||
virtual void SetClipboardText(const char *text, int textLen) = 0; | virtual void [[SetClipboardText]](const char *text, int textLen) = 0; | ||
virtual void SetClipboardText(const wchar_t *text, int textLen) = 0; | virtual void [[SetClipboardText]](const wchar_t *text, int textLen) = 0; | ||
virtual int GetClipboardText(int offset, char *buf, int bufLen) = 0; | virtual int [[GetClipboardText]](int offset, char *buf, int bufLen) = 0; | ||
virtual int GetClipboardText(int offset, wchar_t *buf, int bufLen) = 0; | virtual int [[GetClipboardText]](int offset, wchar_t *buf, int bufLen) = 0; | ||
// windows registry | // windows registry | ||
virtual bool SetRegistryString(const char *key, const char *value) = 0; | virtual bool [[SetRegistryString]](const char *key, const char *value) = 0; | ||
virtual bool GetRegistryString(const char *key, char *value, int valueLen) = 0; | virtual bool [[GetRegistryString]](const char *key, char *value, int valueLen) = 0; | ||
virtual bool SetRegistryInteger(const char *key, int value) = 0; | virtual bool [[SetRegistryInteger]](const char *key, int value) = 0; | ||
virtual bool GetRegistryInteger(const char *key, int &value) = 0; | virtual bool [[GetRegistryInteger]](const char *key, int &value) = 0; | ||
// user config | // user config | ||
virtual KeyValues *GetUserConfigFileData(const char *dialogName, int dialogID) = 0; | virtual KeyValues *[[GetUserConfigFileData]](const char *dialogName, int dialogID) = 0; | ||
// sets the name of the config file to save/restore from. Settings are loaded immediately. | // sets the name of the config file to save/restore from. Settings are loaded immediately. | ||
virtual void SetUserConfigFile(const char *fileName, const char *pathName) = 0; | virtual void [[SetUserConfigFile]](const char *fileName, const char *pathName) = 0; | ||
// saves all the current settings to the user config file | // saves all the current settings to the user config file | ||
virtual void SaveUserConfigFile() = 0; | virtual void [[SaveUserConfigFile]]() = 0; | ||
// sets the watch on global computer use | // sets the watch on global computer use | ||
// returns true if supported | // returns true if supported | ||
virtual bool SetWatchForComputerUse(bool state) = 0; | virtual bool [[SetWatchForComputerUse]](bool state) = 0; | ||
// returns the time, in seconds, since the last computer use. | // returns the time, in seconds, since the last computer use. | ||
virtual double GetTimeSinceLastUse() = 0; | virtual double [[GetTimeSinceLastUse]]() = 0; | ||
// Get a string containing the available drives | // Get a string containing the available drives | ||
Line 50: | Line 44: | ||
// of the strings copied to the buffer, | // of the strings copied to the buffer, | ||
// not including the terminating null character. | // not including the terminating null character. | ||
virtual int GetAvailableDrives(char *buf, int bufLen) = 0; | virtual int [[GetAvailableDrives]](char *buf, int bufLen) = 0; | ||
// exe command line options accessors | // exe command line options accessors | ||
// returns whether or not the parameter was on the command line | // returns whether or not the parameter was on the command line | ||
virtual bool CommandLineParamExists(const char *paramName) = 0; | virtual bool [[CommandLineParamExists]](const char *paramName) = 0; | ||
// returns the full command line, including the exe name | // returns the full command line, including the exe name | ||
virtual const char *GetFullCommandLine() = 0; | virtual const char *[[GetFullCommandLine]]() = 0; | ||
// Convert a windows virtual key code to a VGUI key code. | // Convert a windows virtual key code to a VGUI key code. | ||
virtual KeyCode KeyCode_VirtualKeyToVGUI( int keyCode ) = 0; | virtual KeyCode [[KeyCode_VirtualKeyToVGUI]]( int keyCode ) = 0; | ||
// returns the current local time and date | // returns the current local time and date | ||
// fills in every field that a pointer is given to it for | // fills in every field that a pointer is given to it for | ||
virtual bool GetCurrentTimeAndDate(int *year, int *month, int *dayOfWeek, int *day, int *hour, int *minute, int *second) = 0; | virtual bool [[GetCurrentTimeAndDate]](int *year, int *month, int *dayOfWeek, int *day, int *hour, int *minute, int *second) = 0; | ||
// returns the amount of available disk space, in bytes, on the drive | // returns the amount of available disk space, in bytes, on the drive | ||
// path can be any path, drive letter is stripped out | // path can be any path, drive letter is stripped out | ||
virtual double GetFreeDiskSpace(const char *path) = 0; | virtual double [[GetFreeDiskSpace]](const char *path) = 0; | ||
// shortcut (.lnk) modification functions | // shortcut (.lnk) modification functions | ||
virtual bool CreateShortcut(const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory, const char *iconFile) = 0; | virtual bool [[CreateShortcut]](const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory, const char *iconFile) = 0; | ||
virtual bool GetShortcutTarget(const char *linkFileName, char *targetPath, char *arguments, int destBufferSizes) = 0; | virtual bool [[GetShortcutTarget]](const char *linkFileName, char *targetPath, char *arguments, int destBufferSizes) = 0; | ||
virtual bool ModifyShortcutTarget(const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory) = 0; | virtual bool [[ModifyShortcutTarget]](const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory) = 0; | ||
// gets the string following a command line param | // gets the string following a command line param | ||
//!! move this function up on changing interface version number | //!! move this function up on changing interface version number | ||
virtual bool GetCommandLineParamValue(const char *paramName, char *value, int valueBufferSize) = 0; | virtual bool [[GetCommandLineParamValue]](const char *paramName, char *value, int valueBufferSize) = 0; | ||
// recursively deletes a registry key and all it's subkeys | // recursively deletes a registry key and all it's subkeys | ||
//!! move this function next to other registry function on changing interface version number | //!! move this function next to other registry function on changing interface version number | ||
virtual bool DeleteRegistryKey(const char *keyName) = 0; | virtual bool [[DeleteRegistryKey]](const char *keyName) = 0; | ||
virtual const char *GetDesktopFolderPath() = 0; | virtual const char *[[GetDesktopFolderPath]]() = 0; | ||
}; | }; | ||
[[Category:Interfaces]] | [[Category:Interfaces]] |
Revision as of 19:28, 28 June 2006
class ISystem : public IBaseInterface { public: // use this with the "open" command to launch web browsers/explorer windows, eg. ShellExecute("open", "www.valvesoftware.com") virtual void ShellExecute(const char *command, const char *file) = 0; // returns the time at the start of the frame, in seconds virtual double GetFrameTime() = 0; // returns the current time, in seconds virtual double GetCurrentTime() = 0; // returns the current time, in milliseconds virtual long GetTimeMillis() = 0; // clipboard access virtual int GetClipboardTextCount() = 0; virtual void SetClipboardText(const char *text, int textLen) = 0; virtual void SetClipboardText(const wchar_t *text, int textLen) = 0; virtual int GetClipboardText(int offset, char *buf, int bufLen) = 0; virtual int GetClipboardText(int offset, wchar_t *buf, int bufLen) = 0; // windows registry virtual bool SetRegistryString(const char *key, const char *value) = 0; virtual bool GetRegistryString(const char *key, char *value, int valueLen) = 0; virtual bool SetRegistryInteger(const char *key, int value) = 0; virtual bool GetRegistryInteger(const char *key, int &value) = 0; // user config virtual KeyValues *GetUserConfigFileData(const char *dialogName, int dialogID) = 0; // sets the name of the config file to save/restore from. Settings are loaded immediately. virtual void SetUserConfigFile(const char *fileName, const char *pathName) = 0; // saves all the current settings to the user config file virtual void SaveUserConfigFile() = 0; // sets the watch on global computer use // returns true if supported virtual bool SetWatchForComputerUse(bool state) = 0; // returns the time, in seconds, since the last computer use. virtual double GetTimeSinceLastUse() = 0; // Get a string containing the available drives // If the function succeeds, the return value is the length, in characters, // of the strings copied to the buffer, // not including the terminating null character. virtual int GetAvailableDrives(char *buf, int bufLen) = 0; // exe command line options accessors // returns whether or not the parameter was on the command line virtual bool CommandLineParamExists(const char *paramName) = 0; // returns the full command line, including the exe name virtual const char *GetFullCommandLine() = 0; // Convert a windows virtual key code to a VGUI key code. virtual KeyCode KeyCode_VirtualKeyToVGUI( int keyCode ) = 0; // returns the current local time and date // fills in every field that a pointer is given to it for virtual bool GetCurrentTimeAndDate(int *year, int *month, int *dayOfWeek, int *day, int *hour, int *minute, int *second) = 0; // returns the amount of available disk space, in bytes, on the drive // path can be any path, drive letter is stripped out virtual double GetFreeDiskSpace(const char *path) = 0; // shortcut (.lnk) modification functions virtual bool CreateShortcut(const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory, const char *iconFile) = 0; virtual bool GetShortcutTarget(const char *linkFileName, char *targetPath, char *arguments, int destBufferSizes) = 0; virtual bool ModifyShortcutTarget(const char *linkFileName, const char *targetPath, const char *arguments, const char *workingDirectory) = 0; // gets the string following a command line param //!! move this function up on changing interface version number virtual bool GetCommandLineParamValue(const char *paramName, char *value, int valueBufferSize) = 0; // recursively deletes a registry key and all it's subkeys //!! move this function next to other registry function on changing interface version number virtual bool DeleteRegistryKey(const char *keyName) = 0; virtual const char *GetDesktopFolderPath() = 0; };