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/. */
6 #ifndef __LegacyJumpListBuilder_h__
7 #define __LegacyJumpListBuilder_h__
11 // Needed for various com interfaces
13 #undef LogSeverity // SetupAPI.h #defines this as DWORD
17 #include "nsILegacyJumpListBuilder.h"
18 #include "nsILegacyJumpListItem.h"
19 #include "LegacyJumpListItem.h"
20 #include "nsIObserver.h"
22 #include "mozilla/Attributes.h"
23 #include "mozilla/LazyIdleThread.h"
24 #include "mozilla/mscom/AgileReference.h"
25 #include "mozilla/ReentrantMonitor.h"
31 class DoneCommitListBuildCallback
;
34 class LegacyJumpListBuilder
: public nsILegacyJumpListBuilder
,
36 virtual ~LegacyJumpListBuilder();
39 NS_DECL_THREADSAFE_ISUPPORTS
40 NS_DECL_NSILEGACYJUMPLISTBUILDER
43 LegacyJumpListBuilder();
46 static Atomic
<bool> sBuildingList
;
49 mscom::AgileReference
<ICustomDestinationList
> mJumpListMgr
50 MOZ_GUARDED_BY(mMonitor
);
51 uint32_t mMaxItems
MOZ_GUARDED_BY(mMonitor
);
53 RefPtr
<LazyIdleThread
> mIOThread
;
54 ReentrantMonitor mMonitor
;
55 nsString mAppUserModelId
;
57 bool IsSeparator(nsCOMPtr
<nsILegacyJumpListItem
>& item
);
58 void RemoveIconCacheAndGetJumplistShortcutURIs(IObjectArray
* aObjArray
,
59 nsTArray
<nsString
>& aURISpecs
);
60 void DeleteIconFromDisk(const nsAString
& aPath
);
61 nsresult
RemoveIconCacheForAllItems();
62 void DoCommitListBuild(RefPtr
<detail::DoneCommitListBuildCallback
> aCallback
);
63 void DoInitListBuild(RefPtr
<dom::Promise
>&& aPromise
);
65 friend class WinTaskbar
;
69 } // namespace mozilla
71 #endif /* __LegacyJumpListBuilder_h__ */