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