localisation/apparchitecture/inc/APGWGNAM.H
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #if !defined(__APGWGNAM_H__)
       
    17 #define __APGWGNAM_H__
       
    18 
       
    19 #if !defined(__W32STD_H__)
       
    20 #include <w32std.h>
       
    21 #endif
       
    22 
       
    23 class CApaWindowGroupName : public CBase
       
    24 /** Gives access to the name of a window group and the information encoded by that 
       
    25 name.
       
    26 
       
    27 A window group is associated with a task, i.e. a running application. The 
       
    28 window group's name encodes four pieces of information for that task:
       
    29 
       
    30 the name of the document that the task is handling,
       
    31 
       
    32 the task's caption,
       
    33 
       
    34 the application specific UID, as eight hexadecimal characters,
       
    35 
       
    36 status information for the task, as two hexadecimal characters.
       
    37 
       
    38 @publishedAll
       
    39 @released */
       
    40 	{
       
    41 public:
       
    42 	enum { EMaxLength=13+2*KMaxFileName };
       
    43 public:
       
    44 	IMPORT_C ~CApaWindowGroupName();
       
    45 	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession);
       
    46 	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession);
       
    47 	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, TInt aWgId);
       
    48 	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, TInt aWgId);
       
    49 	IMPORT_C static CApaWindowGroupName* New(const RWsSession& aWsSession, HBufC* aWgName);
       
    50 	IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, const TDesC& aWgName);
       
    51 	IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, const TDesC& aWgName);
       
    52 	IMPORT_C void ConstructFromWgIdL(TInt aWgId);
       
    53 	//
       
    54 	IMPORT_C void SetWindowGroupNameL(const TDesC& aWgName);
       
    55 	IMPORT_C void SetWindowGroupName(HBufC* aWgName);
       
    56 	//
       
    57 	IMPORT_C static void FindByAppUid(TUid aAppUid, RWsSession& aWsSession, TInt& aPrevWgId);
       
    58 	IMPORT_C static void FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId);
       
    59 	IMPORT_C static void FindByDocName(const TDesC& aDocName, RWsSession& aWsSession, TInt& aPrevWgId);
       
    60 	//
       
    61 	IMPORT_C void SetBusy(TBool aBusy);
       
    62 	IMPORT_C TBool IsBusy() const;
       
    63 	IMPORT_C void SetSystem(TBool aSystem);
       
    64 	IMPORT_C TBool IsSystem() const;
       
    65 	IMPORT_C void SetDocNameIsAFile(TBool aDocNameIsAFile);
       
    66 	IMPORT_C TBool DocNameIsAFile() const;
       
    67 	IMPORT_C void SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent);
       
    68 	IMPORT_C TBool RespondsToShutdownEvent() const;
       
    69 	IMPORT_C void SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent);
       
    70 	IMPORT_C TBool RespondsToSwitchFilesEvent() const;
       
    71 	IMPORT_C void SetHidden(TBool aIsHidden);
       
    72 	IMPORT_C TBool Hidden() const;
       
    73 	IMPORT_C void SetAppReady(TBool aIsReady);
       
    74 	IMPORT_C TBool IsAppReady() const;
       
    75 	//
       
    76 	IMPORT_C void SetAppUid(TUid aAppUid);
       
    77 	IMPORT_C TUid AppUid() const;
       
    78 	//
       
    79 	IMPORT_C void SetCaptionL(const TDesC& aCaption);
       
    80 	IMPORT_C TPtrC Caption() const;
       
    81 	//
       
    82 	IMPORT_C void SetDocNameL(const TDesC& aDocName);
       
    83 	IMPORT_C TPtrC DocName() const;
       
    84 	//
       
    85 	IMPORT_C TInt SetWindowGroupName(RWindowGroup& aGroupWin) const;
       
    86 	IMPORT_C TPtrC WindowGroupName() const;
       
    87 private: //enums
       
    88 	enum TApaStatus { ESystem =0x01, EBusy =0x02, EDocNameNotAFile =0x04
       
    89 					 ,EDoesNotRespondToShutdownEvent=0x08, EDoesNotRespondToSwitchFilesEvent=0x10
       
    90 					 ,EIsHidden=0x20, EAppReady=0x40 };
       
    91 	enum TApaDelimiter { EEndStatus=1, EEndUid, EEndCaption, ELast=EEndCaption }; // ELast must be last and same as predecessor
       
    92 private:
       
    93 	CApaWindowGroupName(const RWsSession& aWsSession);
       
    94 	//
       
    95 	void DefaultConstructL();
       
    96 	void WriteStatusToName();
       
    97 	void GetStatusFromName();
       
    98 	TInt FindDelimiter(TApaDelimiter aDelim) const;
       
    99 	void ReAllocIfNecessaryL(TInt aExtraLengthReqd);
       
   100 private:
       
   101 	HBufC* iBuf;
       
   102 	TUint iStatus;
       
   103 	const RWsSession& iWsSession;
       
   104 	};
       
   105 
       
   106 #endif