|
|
|||
Location:
QikViewBase.h
Link against: qikcore.lib
class CQikViewBase : public CQikContainer, public MCoeControlObserver, public MQikCommandModelOwner, public MQikCommandHandler, public MQikControlStateTranferrer, public MQUiConfigChangedObserver;
A base class for views. All UIQ views should derive from this class or the CQikMultiPageViewBase class. The CQikMultiPageViewBase class derives from this class too. This class handles a lot of the new functionality found in UIQ 3.0:
Constructing views, controls and layouts from resource files
Basic focus management
Hardware button navigation between controls
Command handling
Interface for runtime UI configurations changing
Handling of the Contextbar
MQUiConfigChangedObserver - The Ui config observer notifies about Ui config changesMQikControlStateTranferrer - Transfers the state of a control (that cannot be moved from one layout to another) to the control that will be used in its placeMQikCommandHandler - Interface for classes responsible of executing commandsMQikCommandListOwner - Interface for classes adding commandsMQikCommandModelOwner - Interface for classes owning placeholders for command listsMCoeControlObserver - Interface for a control to send events to its observer controlMQikRelayoutSensitiveControl - A mixin for controls that have a special behaviour when a view changes layoutsMQikContainer - A mixin for controls that allows other classes to add and remove controls via a generic APIMEikBorderedControl - Interface for bordered controlsMObjectProvider - An interface that allows an object to be part of a network of object providersCBase - Base class for all classes to be instantiated on the heapCCoeControl - Control base class from which all other controls are derivedCEikBorderedControl - A control which is drawn surrounded by a rectangular borderCQikContainerBase - A generic base class for container controlsCQikContainer - A concrete container controlCQikViewBase - A base class for viewsDefined in CQikViewBase:
ActivateL(), ActivatePreviousViewL(), ActivateTabL(), ActiveTabId(), AddControlLC(), AddTabL(), AddTabL(), BaseConstructL(), BeginUpdateLC(), Border(), CQikViewBase(), CQikViewBase_Reserved_4(), CalculateRowInfo(), CategoryHandleForCommandId(), CategoryModel(), CommandIdForCategoryHandle(), ConstructFromResourceL(), ConstructL(), ContainerWindow(), ControlProvider(), Controls(), Controls(), CurrentCategoryHandle(), Draw(), ECancel, ESave, ETypeId, EViewActivatedL, EViewCategoryAdded, EViewConstructL, EViewInitializeViewFromResourceL, EViewRequestFocusL, EViewSaveL, EViewSetInitialFocusL, EmbeddedLinkEnabled(), EndUpdateL(), FocusChanged(), FocusedControl(), GetColorUseListL(), GetCompatibleViewConfigData(), GetCurrentViewConfigData(), GetHelpContext(), GetTextDrawer(), HandleCommandL(), HandleControlArrayEventL(), HandleControlEventL(), HandleErrorL(), HandlePointerBufferReadyL(), HandlePointerEventL(), HandleResourceChange(), HandleUiConfigChangedL(), HasBorder(), InitializeFromResourceL(), InitializeViewFromResourceL(), InitializeViewFromResourceL(), InputCapabilities(), IsCommandListActive(), IsDefaultView(), IsTabDimmed(), MakeVisible(), MinimumSize(), MopSupplyObject(), OfferKeyEventL(), ParentView(), PerformLayout(), PersistsAfterRelayout(), PositionChanged(), PreemptViewConstructionL(), PreferredUiConfigMode(), PrepareForFocusGainL(), PrepareForFocusLossL(), PrepareForViewActivation(), RelayoutFinishedL(), ReleaseControls(), RemoveControl(), RemoveTabL(), RequestFocusL(), RequestRelayout(), ResetBackBehavior(), SaveL(), SaveThenDnlToL(), SaveThenDnlToL(), SelectCategoryL(), SetAdjacent(), SetAppTitleIconL(), SetAppTitleNameL(), SetBorder(), SetBorder(), SetCategoryModel(), SetCategoryModelAsCommandsL(), SetContainerWindowL(), SetDimmed(), SetEmbeddedLinkEnabled(), SetInitialFocusL(), SetLayoutManagerL(), SetNeighbor(), SetParent(), SetParentView(), SetTabDimmed(), SetTabIndex(), SetTabResponsiveWhenActive(), SetTextBaselineSpacing(), SetViewModeL(), SetViewToolbarL(), SizeChanged(), TSaveMode, TViewError, Tab(), Tab(), TabActivatedL(), TabCount(), TextBaselineOffset(), TransferPersistentControlStateL(), ViewActivatedL(), ViewConstructFromResourceL(), ViewConstructL(), ViewContext(), ViewDeactivated(), ViewId(), ViewMode(), ViewScreenDeviceChangedL(), ViewScreenModeCompatible(), ViewToolbar(), ViewToolbar(), ViewToolbarResourceId(), WriteInternalStateL(), anonymous, iQikAppUi, iViewConfigList, operator class MCoeView &(), operator class MCoeView *(), ~CQikViewBase()
Inherited from CBase:
Delete(),
Extension_(),
operator new()
Inherited from CCoeControl:
AccumulatedZoom(),
ActivateGc(),
BackedUpWindow(),
Background(),
CapturesPointer(),
ClaimPointerGrab(),
CloseWindow(),
Components(),
ControlContext(),
ControlEnv(),
CopyControlContextFrom(),
CreateBackedUpWindowL(),
CreateWindowL(),
DeactivateGc(),
DrawBackground(),
DrawDeferred(),
DrawForeground(),
DrawNow(),
DrawableWindow(),
EAbsoluteZoom,
ERelativeZoom,
EnableDragEvents(),
FindBackground(),
FindFontProvider(),
GetColor(),
GetGc(),
GrabbingComponent(),
HandleComponentControlsResourceChange(),
HandleRedrawEvent(),
HitTest(),
IgnoreEventsUntilNextPointerUp(),
Index(),
InitComponentArrayL(),
IsActivated(),
IsBackedUp(),
IsBeingDestroyed(),
IsBlank(),
IsDimmed(),
IsFocused(),
IsNonFocusing(),
IsReadyToDraw(),
IsVisible(),
LayoutManager(),
MaximumWidth(),
Observer(),
OverrideColorL(),
OwnsWindow(),
Parent(),
Position(),
PositionRelativeToScreen(),
Rect(),
RecursivelyMergedInputCapabilities(),
ReportEventL(),
Reserved_CCoeControl_10(),
Reserved_CCoeControl_11(),
Reserved_CCoeControl_12(),
Reserved_CCoeControl_13(),
ResetGc(),
ScreenFont(),
SetAllowStrayPointers(),
SetBackground(),
SetBlank(),
SetCanDrawOutsideRect(),
SetComponentsToInheritVisibility(),
SetControlContext(),
SetCornerAndSize(),
SetExtent(),
SetExtentToWholeScreen(),
SetFocus(),
SetFocusing(),
SetFontProviderL(),
SetGc(),
SetGloballyCapturing(),
SetHitTest(),
SetMaximumWidth(),
SetMopParent(),
SetNonFocusing(),
SetObserver(),
SetPointerCapture(),
SetPosition(),
SetRect(),
SetSize(),
SetSizeWithoutNotification(),
SetUniqueHandle(),
SetZoomFactorL(),
Size(),
SystemGc(),
TZoomType,
TextDrawer(),
UniqueHandle(),
Window(),
ZoomWithType(),
iCoeEnv,
iContext,
iPosition,
iSize
Inherited from CEikBorderedControl:
ComponentControl(),
CountComponentControls(),
iBorder
Inherited from CQikContainer:
ClosestFocusingControl()
Inherited from CQikContainerBase:
ControlsOwnedExternally(),
HandlesRelayoutRequests(),
HorizontalWrappingEnabled(),
IsRelayoutInProgress(),
RowBasedMode(),
SetDebugMode(),
SetHandleRelayoutRequests(),
SetHorizontalWrappingEnabled(),
SetPersistsAfterRelayout(),
SetRelayoutInProgress(),
SetRowBasedMode(),
SetVerticalWrappingEnabled(),
VerticalWrappingEnabled()
Inherited from MCoeControlObserver:
EEventInteractionRefused,
EEventPrepareFocusTransition,
EEventRequestCancel,
EEventRequestExit,
EEventRequestFocus,
EEventStateChanged,
TCoeEvent
Inherited from MObjectProvider:
MopGetObject(),
MopGetObjectNoChaining()
Inherited from MQikCommandHandler:
HandleAttemptDimmedSelectionL()
Inherited from MQikCommandListOwner:
MapCommandHandler()
Inherited from MQikCommandModelOwner:
DynInitOrDeleteCommandL(),
FindCompatibleUiConfig()
IMPORT_C CQikViewBase(CQikAppUi &aAppUi, const TVwsViewId &aParentViewId);
Constructor.
|
virtual IMPORT_C void ConstructL();
Second phase construction. This function completes the construction of a newly allocated CQikViewBase instance. Usually the concrete implementation of the view class calls this method in its own ConstructL() method. The BaseConstructL() method is called from within this method.
IMPORT_C operator class MCoeView *() const;
Returns the internal MCoeView instance of this view as a pointer.
|
IMPORT_C operator class MCoeView &() const;
Returns the internal MCoeView instance of this view as a reference.
|
IMPORT_C void RequestFocusL(CCoeControl *aNewControl);
Tries to set focus on aNewControl . It also sets all parent controls to have focus.
Passing NULL as parameter defocuses the currently focused control.
For this method to work properly controls must have set their parent pointers correctly with CCoeControl::SetParent()
When focus is set on a control, care must be taken so that the whole control chain gets its focus set. That means that all parents to the control should also set their focus to ETrue . This applies even if they are nonfocusing controls.
Additonally some controls need to do extra work when gaining and losing focus which requires the CCoeControl::PrepareForFocusGainL() and CCoeControl::PrepareForFocusLossL() methods to be called before setting focus.
This method does all this automatically for the focus chain, provided that the parent controls for the controls has been set correctly.
Leaves if the control or one of the controls parents could not gain or lose focus.
|
CCoeControl::SetParent()CCoeControl::PrepareForFocusGainL()CCoeControl::PrepareForFocusLossL()CCoeControl::SetFocus()CCoeControl::SetFocusing()virtual IMPORT_C CCoeControl *FocusedControl();
Returns the control currently in focus.
|
IMPORT_C TVwsViewId ParentView() const;
Returns the logical view that should be activated when ActivatePreviousViewL() is called. The logical view is the view that is normally activated when a go back command is issued and we did not DNL to this view from another application.
|
IMPORT_C void SetParentView(const TVwsViewId &aParentViewId);
Sets the logical view that this view should Go Back to. This should be the view in the same application that normally activates this view. For the default or base view this should normally be set to KNullViewId This is used in ActivatePreviousViewL() , according to the UIQ Style Guide, to activate the correct view.
|
IMPORT_C void ActivatePreviousViewL(TSaveMode aSave=ESave);
You should normally call this method when a Done (save and go back) command has been issued. The previous view is dependent on how one reached this view. For example if one DNL:ed here, activating the previous view would most likely activate the view that we DNL:ed from. Follows the UIQ Style Guide.
The method leaves if activation of the new view fails.
|
IMPORT_C void ResetBackBehavior();
Use this method if you want to break view navigation model for "using multiple applications to complete a single use case". Calling this method will forget which application that launched us, and reset the "go back" view to the parent view.
IMPORT_C CQikControlProvider *ControlProvider();
Gets the control provider.
|
IMPORT_C TBool EmbeddedLinkEnabled() const;
Returns status about if Embedded Links are enabled or not.
|
IMPORT_C void SetEmbeddedLinkEnabled(TBool aEnabled);
Sets if Embedded Links are to be enabled or not.
|
virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
Overloaded from CCoeControl .
Offers aKeyEvent to the control with the current focus. Implements basic focus navigation for following keys:
EDeviceKeyTwoWay
EDeviceKeyFourWay
EDeviceKeyEightWay
EQuartzKeySwitchToNext
EQuartzKeySwitchToPrevious If you override this method, make sure to call this base implementation if you do want to benefit from the frameworks navigation code.
Leaves if OfferKeyEventL for the control that had focus leaved.
|
|
virtual IMPORT_C void MakeVisible(TBool aVisible);
Sets the visibillity of the view.
|
virtual IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
From CCoeControl
|
|
virtual IMPORT_C void ReleaseControls(RQikReleasedControlsArray &aReleasedControls);
Releases all controls prior to a relayout. Is called by InitializeViewFromResourceL() . This function calls MQikRelayoutSensitiveControl::ReleaseControls() (which adds component controls to the set of released controls) on all controls implementing MQikRelayoutSensitiveControl .
Released controls without any unique id, and controls implementing MQikRelayoutSensitiveControl that returns EFalse on PersistsAfterRelayout() are deleted.
The remaining released controls are placed in aReleasedControls .
|
virtual IMPORT_C void GetTextDrawer(CCoeTextDrawerBase *&aTextDrawer, const CCoeControl *aDrawingControl, TInt aKey) const;
Overriden as public. For more details see UIQ Developer Library.
|
virtual IMPORT_C void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);
When aEventType is EEventRequestFocus this will do a RequestFocusL() on the controls that are not already focused. Do not inherit from MCoeControlObserver in your concrete view implementation as CQikViewBase already inherits from it. You could always implement your own behaviour by overriding MCoeControlObserver::HandleControlEventL() . If you want automatic focus transitions when tapping on controls you could in your own implementation call CQikViewBase::HandleControlEventL()
|
virtual TVwsViewId ViewId() const=0;
Returns a TVwsViewId uniquely identifying the view. A view ID includes both an application UID and a specific view UID. The view UID, the second UID, needs only to be unique in the application.
|
virtual IMPORT_C TBool ViewScreenModeCompatible(TInt aScreenMode);
Checks if the view has a configuration compatible with specified screen mode.
This method is called by the viewmanager when a view is activated just after PrepareForViewActivation() is called.
|
|
virtual IMPORT_C void TransferPersistentControlStateL(const CCoeControl &aOldControl, CCoeControl &aNewControl) const;
Is called when a control is about to be deleted due to a relayout when it cannot be reused.
|
MQikControlStateTransferrer::ReleaseControls()protected: IMPORT_C void BaseConstructL();
Initialises the view with standard values. The concrete implementation of the view class must make sure that this method is called during the construction phase. Either by calling the CQikViewBase::ConstructL() method from its own ConstructL() method or by calling this method directly, that is CQikViewBase::BaseConstructL() .
protected: IMPORT_C void PreemptViewConstructionL();
By calling this method you make the view framework call the ViewConstructL method of the specific application view. This should only be done if some control in the view must be created the first time the application is started.
This should normally be avoided due to the increase of the application's start up time.
protected: virtual IMPORT_C void HandleErrorL(TViewError aSource, TInt aError);
Override HandleErrorL if you want to get notified when a TViewError occurs. If you cannot handle the problem within your view, you should continue to propagate the leave.
|
protected: virtual IMPORT_C void InitializeViewFromResourceL(TInt aViewResourceId);
Wraps aViewresourceId into a TQikViewConfigData and forward the call to InitializeViewFromResourceL() .
|
protected: virtual IMPORT_C void InitializeViewFromResourceL(const TQikViewConfigData &aViewConfigData);
Initializes the controls and layout of a view. It starts by releasing the current controls. It then creates the new controls and layout using the requested page layout. Controls that were released and that are part of the new layout are reused if possible. When finished, RequestRelayoutL() is called.
This method is called automatically by ViewConstructFromResourceL() . It is also called automatically by HandleUiConfigChangedL() when the ui configuration changes and there is another resource specified for the layout in the new ui configuration.
The default implementation reads a resource of type QIK_VIEW
|
protected: IMPORT_C void ViewConstructFromResourceL(TInt aViewConfigurations, TInt aQikControlCollection=0);
This is the entry point when creating a view that shall support more than one UI configuration. Loads information about the UI configurations this view supports together with definition of each view, its layout and commands.
The first parameter is a QIK_VIEW_CONFIGURATION resource which defines:
ui-configuration (TQikScreenMode | TQikTouchScreen | TQikInteractionStyle | TQikOrientation ),
command_list (QIK_COMMAND_LIST defined in qikcommand.rh)
view (QIK_VIEW struct which will be passed to InitializeViewFromResourceL() )
This method should preferably be called from your view's ViewConstructL .
|
TQikScreenModeTQikTouchScreenTQikInteractionStyleTQikOrientationInitializeViewFromResourceL()QIK_VIEW_CONFIGURATIONSQIK_VIEW_CONFIGURATIONQIK_COMMAND_LISTQIK_CONTROL_COLLECTIONprotected: virtual IMPORT_C void SaveL();
This method is called asynchronously just before the call to ViewDeactivated occurs. Exceptions:
When SaveThenDnlTo is used, in that case a synchronous call to SaveL is made before focus leaves this view.
Another exception is when memory allocation for an asynchronous save event fails, then SaveL is called synchronously.
If an asynchronous save event have not had time to execute when the view is destroyed, a synchronous call occur.
When the same view is activated a second time, for example if you are creating a new Contact and the "beam received" dialog pops up and you select to view the received Contact, a synchronous call to SaveL occurs before the "new" call to ViewActivatedL .
protected: IMPORT_C void SaveThenDnlToL(const TVwsViewId &aViewId);
Makes a synchronous call to SaveL and then forward this call to CQikAppUi::ActivateViewL() .
|
protected: IMPORT_C void SaveThenDnlToL(const TVwsViewId &aViewId, const TUid &aCustomMessageId, const TDesC8 &aCustomMessage);
Makes a synchronous call to SaveL and then forward this call to CQikAppUi::ActivateViewL() . ActivateViewL() then activates the specified application view and passes a message to it.
|
protected: IMPORT_C CQikCategoryModel *CategoryModel() const;
Returns the CategoryModel set to this view by SetCategoryModel().
|
protected: IMPORT_C void SetCategoryModel(CQikCategoryModel *aCategoryModel);
Set the CategoryModel to be used. Takes ownership. You can retain ownership by calling this method with NULL as parameter.
|
protected: IMPORT_C void SetCategoryModelAsCommandsL();
Creates a copy of the CategoryModel in all of this view's CommandLists (different lists may exist for different ui-configurations). After that Additions, removal and renames of items in the CategoryModel is observered and automatically reflected in the corresponding Command. (This method can be called more than once because it always start with deleting the existing category-commands)
In softkey configurations a Named group is created to cascade the categories. By default that named group is inserted with priority 50 (good to know if you want to control where it is sorted in the menupane). After calling this method, the name of any selected Category other than All will be displayed in the titlebar.
protected: IMPORT_C TInt CurrentCategoryHandle() const;
Get method for data member holding the current category handle.
|
protected: IMPORT_C TInt CommandIdForCategoryHandle(TInt aHandle) const;
Use this method if you want to find out the Command Id corresponding to a certain Category Handle
|
|
protected: IMPORT_C TInt CategoryHandleForCommandId(TInt aCommandId) const;
Use this method if you want to find out the Category Handle corresponding to a certain Command Id
|
|
protected: IMPORT_C void SelectCategoryL(TInt aHandle);
Selects a category. This will update the iCurrentCategoryHandle as well as update the App Title Bar if available.
|
protected: IMPORT_C TInt GetCurrentViewConfigData(TQikViewConfigData &aCurrentViewConfigData) const;
Returns current view configuration.
|
|
protected: IMPORT_C TInt GetCompatibleViewConfigData(TQikViewConfigData &aCurrentViewConfigData) const;
Returns the current view configuration or, if there is no compatible view configuration, returns a viewconfiguration that can be used on this device after changing screenmode (which is done in PrepareForViewActivation() ).
|
|
protected: virtual IMPORT_C TInt PreferredUiConfigMode() const;
Specifies if a view has a preferred ui configuration mode that should be switched to when the view is activated.
|
protected: virtual IMPORT_C void RelayoutFinishedL();
Is called after a relayout is finished The default implementaion activates all controls in the view, and hides the remaining released controls.
protected: virtual IMPORT_C void PerformLayout();
Performs a layout of the view. If the view has multiple pages, all pages layouts are performed
IMPORT_C TQikViewMode ViewMode() const;
This method retrieves the current view mode.
Returns a value of type TQikViewMode combining different boolean values or flags. These values indicate the use of different screen furniture in the the current view mode.
Use the exported functions in TQikViewMode to inquire whether a specific piece of screen furniture is being used or not. For example, UsesAppTitleBar() returns ETrue if the Application Title Bar is being used in the current view mode and EFalse if it is not being used.
|
protected: IMPORT_C void SetViewModeL(const TQikViewMode &aMode);
Set method for the view mode data member.
Use this method to control full-screen behavior. Screen furniture can be turned on/off individually in the TQikViewMode given as parameter to this method.
Updating the view mode is a two stage process. First, use the exported functions in TQikViewMode to set the boolean values in the TQikViewMode object. These determine which pieces of screen furniture will be used in the view mode once it is updated. For example, calling SetButtonOrSoftkeyBar(ETrue) adds the button bar or softkey bar to the list of screen furniture in the TQikViewMode object; calling SetButtonOrSoftkeyBar(EFalse) removes the button bar or softkey bar from the list. Once all of the values in the TQikViewMode object have been updated to reflect the new view mode, pass the list, the TQikViewMode object, as an argument to SetViewModeL() to finally set the view mode.
|