1.1 --- a/epoc32/include/apgwgnam.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/apgwgnam.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,106 @@
1.4 -apgwgnam.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#if !defined(__APGWGNAM_H__)
1.21 +#define __APGWGNAM_H__
1.22 +
1.23 +#if !defined(__W32STD_H__)
1.24 +#include <w32std.h>
1.25 +#endif
1.26 +
1.27 +class CApaWindowGroupName : public CBase
1.28 +/** Gives access to the name of a window group and the information encoded by that
1.29 +name.
1.30 +
1.31 +A window group is associated with a task, i.e. a running application. The
1.32 +window group's name encodes four pieces of information for that task:
1.33 +
1.34 +the name of the document that the task is handling,
1.35 +
1.36 +the task's caption,
1.37 +
1.38 +the application specific UID, as eight hexadecimal characters,
1.39 +
1.40 +status information for the task, as two hexadecimal characters.
1.41 +
1.42 +@publishedAll
1.43 +@released */
1.44 + {
1.45 +public:
1.46 + enum { EMaxLength=13+2*KMaxFileName };
1.47 +public:
1.48 + IMPORT_C ~CApaWindowGroupName();
1.49 + IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession);
1.50 + IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession);
1.51 + IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, TInt aWgId);
1.52 + IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, TInt aWgId);
1.53 + IMPORT_C static CApaWindowGroupName* New(const RWsSession& aWsSession, HBufC* aWgName);
1.54 + IMPORT_C static CApaWindowGroupName* NewL(const RWsSession& aWsSession, const TDesC& aWgName);
1.55 + IMPORT_C static CApaWindowGroupName* NewLC(const RWsSession& aWsSession, const TDesC& aWgName);
1.56 + IMPORT_C void ConstructFromWgIdL(TInt aWgId);
1.57 + //
1.58 + IMPORT_C void SetWindowGroupNameL(const TDesC& aWgName);
1.59 + IMPORT_C void SetWindowGroupName(HBufC* aWgName);
1.60 + //
1.61 + IMPORT_C static void FindByAppUid(TUid aAppUid, RWsSession& aWsSession, TInt& aPrevWgId);
1.62 + IMPORT_C static void FindByCaption(const TDesC& aCaption, RWsSession& aWsSession, TInt& aPrevWgId);
1.63 + IMPORT_C static void FindByDocName(const TDesC& aDocName, RWsSession& aWsSession, TInt& aPrevWgId);
1.64 + //
1.65 + IMPORT_C void SetBusy(TBool aBusy);
1.66 + IMPORT_C TBool IsBusy() const;
1.67 + IMPORT_C void SetSystem(TBool aSystem);
1.68 + IMPORT_C TBool IsSystem() const;
1.69 + IMPORT_C void SetDocNameIsAFile(TBool aDocNameIsAFile);
1.70 + IMPORT_C TBool DocNameIsAFile() const;
1.71 + IMPORT_C void SetRespondsToShutdownEvent(TBool aRespondsToShutdownEvent);
1.72 + IMPORT_C TBool RespondsToShutdownEvent() const;
1.73 + IMPORT_C void SetRespondsToSwitchFilesEvent(TBool aRespondsToSwitchFilesEvent);
1.74 + IMPORT_C TBool RespondsToSwitchFilesEvent() const;
1.75 + IMPORT_C void SetHidden(TBool aIsHidden);
1.76 + IMPORT_C TBool Hidden() const;
1.77 + IMPORT_C void SetAppReady(TBool aIsReady);
1.78 + IMPORT_C TBool IsAppReady() const;
1.79 + //
1.80 + IMPORT_C void SetAppUid(TUid aAppUid);
1.81 + IMPORT_C TUid AppUid() const;
1.82 + //
1.83 + IMPORT_C void SetCaptionL(const TDesC& aCaption);
1.84 + IMPORT_C TPtrC Caption() const;
1.85 + //
1.86 + IMPORT_C void SetDocNameL(const TDesC& aDocName);
1.87 + IMPORT_C TPtrC DocName() const;
1.88 + //
1.89 + IMPORT_C TInt SetWindowGroupName(RWindowGroup& aGroupWin) const;
1.90 + IMPORT_C TPtrC WindowGroupName() const;
1.91 +private: //enums
1.92 + enum TApaStatus { ESystem =0x01, EBusy =0x02, EDocNameNotAFile =0x04
1.93 + ,EDoesNotRespondToShutdownEvent=0x08, EDoesNotRespondToSwitchFilesEvent=0x10
1.94 + ,EIsHidden=0x20, EAppReady=0x40 };
1.95 + enum TApaDelimiter { EEndStatus=1, EEndUid, EEndCaption, ELast=EEndCaption }; // ELast must be last and same as predecessor
1.96 +private:
1.97 + CApaWindowGroupName(const RWsSession& aWsSession);
1.98 + //
1.99 + void DefaultConstructL();
1.100 + void WriteStatusToName();
1.101 + void GetStatusFromName();
1.102 + TInt FindDelimiter(TApaDelimiter aDelim) const;
1.103 + void ReAllocIfNecessaryL(TInt aExtraLengthReqd);
1.104 +private:
1.105 + HBufC* iBuf;
1.106 + TUint iStatus;
1.107 + const RWsSession& iWsSession;
1.108 + };
1.109 +
1.110 +#endif