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 __JumpListBuilder_h__
7 #define __JumpListBuilder_h__
11 // Needed for various com interfaces
13 #undef LogSeverity // SetupAPI.h #defines this as DWORD
17 #include "nsIJumpListBuilder.h"
18 #include "nsIJumpListItem.h"
19 #include "JumpListItem.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 JumpListBuilder
: public nsIJumpListBuilder
, public nsIObserver
{
35 virtual ~JumpListBuilder();
38 NS_DECL_THREADSAFE_ISUPPORTS
39 NS_DECL_NSIJUMPLISTBUILDER
45 static Atomic
<bool> sBuildingList
;
48 mscom::AgileReference mJumpListMgr
MOZ_GUARDED_BY(mMonitor
);
49 uint32_t mMaxItems
MOZ_GUARDED_BY(mMonitor
);
51 RefPtr
<LazyIdleThread
> mIOThread
;
52 ReentrantMonitor mMonitor
;
53 nsString mAppUserModelId
;
55 bool IsSeparator(nsCOMPtr
<nsIJumpListItem
>& item
);
56 void RemoveIconCacheAndGetJumplistShortcutURIs(IObjectArray
* aObjArray
,
57 nsTArray
<nsString
>& aURISpecs
);
58 void DeleteIconFromDisk(const nsAString
& aPath
);
59 nsresult
RemoveIconCacheForAllItems();
60 void DoCommitListBuild(RefPtr
<detail::DoneCommitListBuildCallback
> aCallback
);
61 void DoInitListBuild(RefPtr
<dom::Promise
>&& aPromise
);
63 friend class WinTaskbar
;
67 } // namespace mozilla
69 #endif /* __JumpListBuilder_h__ */