uitoolkit.h

来自「这是VCF框架的代码」· C头文件 代码 · 共 1,066 行 · 第 1/3 页

H
1,066
字号
	/**	*Override this - this should return whatever the appropriate x/y deltas	*are for starting a drag drop operation are for the specific windowing system	*/	static Size getDragDropDelta();	static const Image* getStandardStopImage();	static const Image* getStandardWarningImage();	static const Image* getStandardQuestionImage();	static const Image* getStandardInformationImage();	static void registerComponentInfo( const String& componentUUID, ComponentInfo* info );	static void removeComponentInfo( ComponentInfo* info );	static void registerAccelerator( AcceleratorKey* accelerator );	static void removeAccelerator( const VirtualKeyCode& keyCode, const ulong32& modifierMask, Object* src );	static Button* getDefaultButton();	static void setDefaultButton( Button* defaultButton );	static void removeDefaultButton( Button* defaultButton );	static AcceleratorKey* getAccelerator( const VirtualKeyCode& keyCode, const ulong32& modifierMask, Object* src );	/**	Finds all the matching accelerators and store them in a list.	A matching accelerator is defined as an accelerator that has the same key code, 	modifier mask, and event handler. This let the synchronize the state of all	the matching accelerators when one of them has its changed enabled/disabled state.	*/	static bool findMatchingAccelerators( AcceleratorKey* key, std::vector<AcceleratorKey*>& matchingAccelerators );	static void removeAcceleratorKeysForControl( Control* control );	static void removeAcceleratorKeysForMenuItem( MenuItem* item );	static void removeAcceleratorKeysForObject( Object* src );	static void handleKeyboardEvent( KeyboardEvent* event );	static VirtualKeyCode findMnemonic( const String& caption );	static ComponentInfo* getComponentInfo( const String& componentUUID );	static ComponentInfo* getComponentInfo( Class* componentClass );	static UIMetricsManager* getUIMetricsManager();	static double getUIMetricValue( const UIMetricsManager::MetricType& type, const String& text="" );	static Size getUIMetricSize( const UIMetricsManager::MetricType& type, const String& text="" );	static Rect getUIMetricRect( const UIMetricsManager::MetricType& type, Rect* rect=NULL );	static UIPolicyManager* getUIPolicyManager();	/**		This attempts to to display the help contents for the application.		It first checks to see if there's a running Application instance.	If there is, then it calls the Application's virtual displayHelpContents()	which lets the application have first crack at this. If 	Application::displayHelpContents() returns true, then the function exits,	if it does not then it attempts to determine the help book and help directory	using this set of methods:	\li it checks for the running app instance, and if it finds it, then it 	requests the application to fill in the help book and help directory	(these are virtual methods that can be overridden). 	\li if no app is found or the help dir or help book entries are still	empty, then the toolkit attempts to extract this from the resource bundle's 	book and help directory entries.	\li if the entries are still empty, then the help book becomes the 	applications name (Application::getName()) or the executables name (	without the extension), and the help directory is assumed to be "Help".		So if you do nothing all, provide no overridden functions, or 	resource bundle support for program info entries, then the default	help would be look something like this, assuming the 	app is in c:/Program Files/MyApp/MyApp.exe, the help book	would be "MyApp" and the the peers would look in the directory	c:/Program Files/MyApp/Help/ for the help content.	@see Application::displayHelpContents()	@see Application::getHelpInfo()	*/	static void displayHelpContents();	/**		This attempts to to display the help index for the application.		It first checks to see if there's a running Application instance.	If there is, then it calls the Application's virtual displayHelpContents()	which lets the application have first crack at this. If 	Application::displayHelpContents() returns true, then the function exits,	if it does not then it attempts to determine the help book and help directory	using this set of methods:	\li it checks for the running app instance, and if it finds it, then it 	requests the application to fill in the help book and help directory	(these are virtual methods that can be overridden). 	\li if no app is found or the help dir or help book entries are still	empty, then the toolkit attempts to extract this from the resource bundle's 	book and help directory entries.	\li if the entries are still empty, then the help book becomes the 	applications name (Application::getName()) or the executables name (	without the extension), and the help directory is assumed to be "Help".		So if you do nothing all, provide no overridden functions, or 	resource bundle support for program info entries, then the default	help would be look something like this, assuming the 	app is in c:/Program Files/MyApp/MyApp.exe, the help book	would be "MyApp" and the the peers would look in the directory	c:/Program Files/MyApp/Help/ for the help content.	@see Application::displayHelpContents()	@see Application::getHelpInfo()	*/	static void displayHelpIndex();	/**		This attempts to to display a specific help section for a given	help book and help directory. The help section is normally assumed 	to be an anchor ref. This method allows you exact control over what 	gets loaded. The helpBookName and helpDirectory may be	be empty strings.		If the helpBookName or helpDirectory are empty the toolkit	first checks to see if there's a running Application instance.	It then attempts to determine the help book and help directory	using this set of methods:	\li it checks for the running app instance, and if it finds it, then it 	requests the application to fill in the help book and help directory	(these are virtual methods that can be overridden). 	\li if no app is found or the help dir or help book entries are still	empty, then the toolkit attempts to extract this from the resource bundle's 	book and help directory entries.	\li if the entries are still empty, then the help book becomes the 	applications name (Application::getName()) or the executables name (	without the extension), and the help directory is assumed to be "Help".	So if you do nothing all, provide no overridden functions, or 	resource bundle support for program info entries, then the default	help would be look something like this, assuming the 	app is in c:/Program Files/MyApp/MyApp.exe, the help book	would be "MyApp" and the the peers would look in the directory	c:/Program Files/MyApp/Help/ for the help content.	@see Application::displayHelpContents()	@see Application::getHelpInfo()	*/	static void displayHelpSection( const String& helpSection, const String& helpBookName="", const String& helpDirectory="" );	/**		This attempts to display the context sensitive help for a control. It is 	triggered by the underlying windowing platform, usually as a result of 	the user hitting the F1 key.	When this is called it first calls the toolkit's internal_displayContextHelpForControl(),	this is turn will trigger the control's ControlHelpRequested delegate and fire and	event. The WhatsThisHelpEvent has a member variable called helpString, and can be	set to override the the value of the control's getWhatThisHelpString(). If the	event's helpString member is not empty, \em or the controls getWhatThisHelpString()	returns a non empty string, then the OS specific portion of the context help display	should take place and the internal_displayContextHelpForControl() will return true.	For Win32 systems this generally means the display of popup help.		However, if internal_displayContextHelpForControl() returns false, then the toolkit 	performs the following actions:	\li It first fires a HelpEvent on the control's HelpRequested delegate. When this returns	if the event's helpSection value is an empty string, then the toolkit gets the	control's parent and does the same thing, continuing to do so until it receives 	a NULL parent, or finds a non empty helpSection string. 	\li if the helpSection from the event is not empty the toolkit will then call 	UIToolkit::displayHelpSection() passing in the values of the event's helpSection,	helpBook, and helpDirectory.	*/	static void displayContextHelpForControl( Control* control );	/**	public so platform implementers can get at it easily	*/	static UIToolkit* internal_getDefaultUIToolkit();	static void addToUpdateList( Component* component );	static void removeFromUpdateList( Component* component );	static void setUpdateTimerSpeed( const unsigned long& milliseconds );	static void systemSettingsChanged();protected:	static UIToolkit* toolKitInstance;	std::map<String,ComponentInfo*> componentInfoMap_;	std::multimap<ulong32,AcceleratorKey*> acceleratorMap_;	std::vector<Control*> visitedContainers_;	Clipboard* systemClipboard_;    GraphicsToolkit * graphicsToolKit_;	Image* stopImage_;	Image* warningImage_;	Image* informationImage_;	Image* questionImage_;	EventHandler* acceleratorMnemonicHandler_;	EventHandler* defaultButtonHandler_;	UIMetricsManager* metricsMgr_;	UIPolicyManager* policyMgr_;	std::vector<Button*> defaultButtonList_;	std::vector<Component*> componentsToUpdate_;	void onAcceleratorMnemonic( KeyboardEvent* event );	void onDefaultButton( KeyboardEvent* event );	/**	*creates a new instance of a ControlPeer	*the component passed in represents the component the implmenter will get attached to.	*/    virtual ControlPeer* internal_createControlPeer( Control* component, ComponentType componentType=CT_DEFAULT) = 0;	virtual ContextPeer* internal_createContextPeer( Control* component );	virtual ContextPeer* internal_createContextPeer( OSHandleID contextID );	virtual ContextPeer* internal_createContextPeer( const unsigned long& width, const unsigned long& height );    virtual ListviewPeer* internal_createListViewPeer( ListViewControl* component) = 0;    virtual TreePeer* internal_createTreePeer( TreeControl* component) = 0;	virtual TextPeer* internal_createTextPeer( const bool& autoWordWrap, const bool& multiLined ) = 0;    virtual TextEditPeer* internal_createTextEditPeer( TextControl* component, const bool& isMultiLineControl ) = 0;    virtual ButtonPeer* internal_createButtonPeer( CommandButton* component) = 0;    virtual DialogPeer* internal_createDialogPeer( Control* owner, Dialog* component) = 0;	virtual DialogPeer* internal_createDialogPeer() = 0;    virtual WindowPeer* internal_createWindowPeer( Control* component, Control* owner) = 0;	virtual ToolbarPeer* internal_createToolbarPeer( Toolbar* toolbar ) = 0;	virtual MenuItemPeer* internal_createMenuItemPeer( MenuItem* item ) = 0;	virtual MenuBarPeer* internal_createMenuBarPeer( MenuBar* menuBar ) = 0;	virtual PopupMenuPeer* internal_createPopupMenuPeer( PopupMenu* popupMenu ) = 0;    virtual ClipboardPeer* internal_createClipboardPeer() = 0;    virtual DragDropPeer* internal_createDragDropPeer() = 0;	virtual DataObjectPeer* internal_createDataObjectPeer() = 0;	virtual DropTargetPeer* internal_createDropTargetPeer() = 0;	virtual ApplicationPeer* internal_createApplicationPeer() = 0;	virtual Clipboard* internal_getSystemClipboard();	virtual CommonFileDialogPeer* internal_createCommonFileOpenDialogPeer( Control* owner ) = 0;	virtual CommonFolderBrowseDialogPeer* internal_createCommonFolderBrowseDialogPeer( Control* owner ) = 0;	virtual CommonFileDialogPeer* internal_createCommonFileSaveDialogPeer( Control* owner ) = 0;	virtual CommonColorDialogPeer* internal_createCommonColorDialogPeer( Control* owner ) = 0;	virtual CommonFontDialogPeer* internal_createCommonFontDialogPeer( Control* owner ) = 0;	virtual CommonPrintDialogPeer* internal_createCommonPrintDialogPeer( Control* owner ) = 0;	virtual DesktopPeer* internal_createDesktopPeer( Desktop* desktop ) = 0;	virtual ScrollPeer* internal_createScrollPeer( Control* control ) = 0;	virtual CursorPeer* internal_createCursorPeer( Cursor* cursor ) = 0;	virtual SystemTrayPeer* internal_createSystemTrayPeer() = 0;	virtual  MenuManagerPeer* internal_createMenuManagerPeer() = 0;	virtual GraphicsResourceBundlePeer* internal_createGraphicsResourceBundlePeer( AbstractApplication* app ) = 0;	virtual bool internal_createCaret( Control* owningControl, Image* caretImage  ) = 0;	virtual bool internal_destroyCaret( Control* owningControl ) = 0;	virtual void internal_setCaretVisible( const bool& caretVisible ) = 0;	virtual void internal_setCaretPos( Point* point ) = 0;	virtual void internal_postEvent( EventHandler* eventHandler, Event* event, const bool& deleteHandler=true ) = 0;	virtual void internal_registerTimerHandler( Object* source, EventHandler* handler, const ulong32& timeoutInMilliSeconds ) = 0;	virtual void internal_unregisterTimerHandler( EventHandler* handler ) = 0;	/*	*this runs an event loop - the imeplementation is entirely system specific and	*in implemented in subclasses of UIToolkit	*/	virtual void internal_runEventLoop() = 0;	virtual ModalReturnType internal_runModalEventLoopFor( Control* control ) = 0;	/**	this will attempt to send a message/event to the underlying windowing system's	event loop (started due to a call to runEventLoop() or runModalEventLoopFor(...) )	and get it to quit running. It will not block and will return immediately.	If an event loop ends, and there are no more event loops running then the	application may quit cleanly.	<p>On the Win32 system this is implemented with a PostQuitMessage(0)	*/	virtual void internal_quitCurrentEventLoop() = 0;	/**	*This method creates a new event from native windowing OS event	*data. Each UIToolkit implementation must implement this method	*and since we can't possibly know the event data at this point,	*we just specify a void*. The concrete implementation will have to	*typecast this to the specific datatype or structure.	*/	virtual Event* internal_createEventFromNativeOSEventData( void* eventData ) = 0;	/**	*Override this - this should return whatever the appropriate x/y deltas	*are for starting a drag drop operation are for the specific windowing system	*/	virtual Size internal_getDragDropDelta() = 0;	virtual void internal_displayHelpContents( const String& helpBookName, const String& helpDirectory ) = 0;	virtual void internal_displayHelpIndex( const String& helpBookName, const String& helpDirectory ) = 0;	virtual void internal_displayHelpSection( const String& helpBookName, const String& helpDirectory, const String& helpSection ) = 0;	/**	This should display the appropriate context sensitive infor for the control,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?