|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef __JumpListBuilder_h__ |
|
7 #define __JumpListBuilder_h__ |
|
8 |
|
9 #include <windows.h> |
|
10 |
|
11 #undef NTDDI_VERSION |
|
12 #define NTDDI_VERSION NTDDI_WIN7 |
|
13 // Needed for various com interfaces |
|
14 #include <shobjidl.h> |
|
15 #undef LogSeverity // SetupAPI.h #defines this as DWORD |
|
16 |
|
17 #include "nsString.h" |
|
18 #include "nsIMutableArray.h" |
|
19 |
|
20 #include "nsIJumpListBuilder.h" |
|
21 #include "nsIJumpListItem.h" |
|
22 #include "JumpListItem.h" |
|
23 #include "nsIObserver.h" |
|
24 #include "mozilla/Attributes.h" |
|
25 |
|
26 namespace mozilla { |
|
27 namespace widget { |
|
28 |
|
29 class JumpListBuilder : public nsIJumpListBuilder, |
|
30 public nsIObserver |
|
31 { |
|
32 public: |
|
33 NS_DECL_ISUPPORTS |
|
34 NS_DECL_NSIJUMPLISTBUILDER |
|
35 NS_DECL_NSIOBSERVER |
|
36 |
|
37 JumpListBuilder(); |
|
38 virtual ~JumpListBuilder(); |
|
39 |
|
40 protected: |
|
41 static bool sBuildingList; |
|
42 |
|
43 private: |
|
44 nsRefPtr<ICustomDestinationList> mJumpListMgr; |
|
45 uint32_t mMaxItems; |
|
46 bool mHasCommit; |
|
47 nsCOMPtr<nsIThread> mIOThread; |
|
48 |
|
49 bool IsSeparator(nsCOMPtr<nsIJumpListItem>& item); |
|
50 nsresult TransferIObjectArrayToIMutableArray(IObjectArray *objArray, nsIMutableArray *removedItems); |
|
51 nsresult RemoveIconCacheForItems(nsIMutableArray *removedItems); |
|
52 nsresult RemoveIconCacheForAllItems(); |
|
53 |
|
54 friend class WinTaskbar; |
|
55 }; |
|
56 |
|
57 } // namespace widget |
|
58 } // namespace mozilla |
|
59 |
|
60 #endif /* __JumpListBuilder_h__ */ |
|
61 |