williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #if !defined(__APGWGNAM_H__) williamr@2: #define __APGWGNAM_H__ williamr@2: williamr@2: #if !defined(__W32STD_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: class CApaWindowGroupName : public CBase williamr@2: /** Gives access to the name of a window group and the information encoded by that williamr@2: name. williamr@2: williamr@2: A window group is associated with a task, i.e. a running application. The williamr@2: window group's name encodes four pieces of information for that task: williamr@2: williamr@2: the name of the document that the task is handling, williamr@2: williamr@2: the task's caption, williamr@2: williamr@2: the application specific UID, as eight hexadecimal characters, williamr@2: williamr@2: status information for the task, as two hexadecimal characters. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: enum { EMaxLength=13+2*KMaxFileName }; williamr@2: public: williamr@2: IMPORT_C ~CApaWindowGroupName(); williamr@2: IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession); williamr@2: IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession); williamr@2: IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, TInt aWgId); williamr@2: IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, TInt aWgId); williamr@2: IMPORT_C static CApaWindowGroupName* New(const RWsSession& aWsSession, HBufC* aWgName); williamr@2: IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, const TDesC& aWgName); williamr@2: IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, const TDesC& aWgName); williamr@2: IMPORT_C void ConstructFromWgIdL(TInt aWgId); williamr@2: // williamr@2: IMPORT_C void SetWindowGroupNameL(const TDesC& aWgName); williamr@2: IMPORT_C void SetWindowGroupName(HBufC* aWgName); williamr@2: // williamr@2: IMPORT_C static void FindByAppUid(TUid aAppUid, RWsSession& aWsSession, TInt& aPrevWgId); williamr@2: IMPORT_C static void FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId); williamr@2: IMPORT_C static void FindByDocName(const TDesC& aDocName, RWsSession& aWsSession, TInt& aPrevWgId); williamr@2: // williamr@2: IMPORT_C void SetBusy(TBool aBusy); williamr@2: IMPORT_C TBool IsBusy() const; williamr@2: IMPORT_C void SetSystem(TBool aSystem); williamr@2: IMPORT_C TBool IsSystem() const; williamr@2: IMPORT_C void SetDocNameIsAFile(TBool aDocNameIsAFile); williamr@2: IMPORT_C TBool DocNameIsAFile() const; williamr@2: IMPORT_C void SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent); williamr@2: IMPORT_C TBool RespondsToShutdownEvent() const; williamr@2: IMPORT_C void SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent); williamr@2: IMPORT_C TBool RespondsToSwitchFilesEvent() const; williamr@2: IMPORT_C void SetHidden(TBool aIsHidden); williamr@2: IMPORT_C TBool Hidden() const; williamr@2: IMPORT_C void SetAppReady(TBool aIsReady); williamr@2: IMPORT_C TBool IsAppReady() const; williamr@2: // williamr@2: IMPORT_C void SetAppUid(TUid aAppUid); williamr@2: IMPORT_C TUid AppUid() const; williamr@2: // williamr@2: IMPORT_C void SetCaptionL(const TDesC& aCaption); williamr@2: IMPORT_C TPtrC Caption() const; williamr@2: // williamr@2: IMPORT_C void SetDocNameL(const TDesC& aDocName); williamr@2: IMPORT_C TPtrC DocName() const; williamr@2: // williamr@2: IMPORT_C TInt SetWindowGroupName(RWindowGroup& aGroupWin) const; williamr@2: IMPORT_C TPtrC WindowGroupName() const; williamr@2: private: //enums williamr@2: enum TApaStatus { ESystem =0x01, EBusy =0x02, EDocNameNotAFile =0x04 williamr@2: ,EDoesNotRespondToShutdownEvent=0x08, EDoesNotRespondToSwitchFilesEvent=0x10 williamr@2: ,EIsHidden=0x20, EAppReady=0x40 }; williamr@2: enum TApaDelimiter { EEndStatus=1, EEndUid, EEndCaption, ELast=EEndCaption }; // ELast must be last and same as predecessor williamr@2: private: williamr@2: CApaWindowGroupName(const RWsSession& aWsSession); williamr@2: // williamr@2: void DefaultConstructL(); williamr@2: void WriteStatusToName(); williamr@2: void GetStatusFromName(); williamr@2: TInt FindDelimiter(TApaDelimiter aDelim) const; williamr@2: void ReAllocIfNecessaryL(TInt aExtraLengthReqd); williamr@2: private: williamr@2: HBufC* iBuf; williamr@2: TUint iStatus; williamr@2: const RWsSession& iWsSession; williamr@2: }; williamr@2: williamr@2: #endif