Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / widget / windows / JumpListBuilder.h
blobf190d0fe02ed3cb6e19a68ef33b2244a31a02661
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__
9 #include <windows.h>
11 // Needed for various com interfaces
12 #include <shobjidl.h>
13 #undef LogSeverity // SetupAPI.h #defines this as DWORD
15 #include "nsString.h"
17 #include "nsIJumpListBuilder.h"
18 #include "nsIJumpListItem.h"
19 #include "JumpListItem.h"
20 #include "nsIObserver.h"
21 #include "nsTArray.h"
22 #include "mozilla/Attributes.h"
23 #include "mozilla/LazyIdleThread.h"
24 #include "mozilla/mscom/AgileReference.h"
25 #include "mozilla/ReentrantMonitor.h"
27 namespace mozilla {
28 namespace widget {
30 namespace detail {
31 class DoneCommitListBuildCallback;
32 } // namespace detail
34 class JumpListBuilder : public nsIJumpListBuilder, public nsIObserver {
35 virtual ~JumpListBuilder();
37 public:
38 NS_DECL_THREADSAFE_ISUPPORTS
39 NS_DECL_NSIJUMPLISTBUILDER
40 NS_DECL_NSIOBSERVER
42 JumpListBuilder();
44 protected:
45 static Atomic<bool> sBuildingList;
47 private:
48 mscom::AgileReference mJumpListMgr MOZ_GUARDED_BY(mMonitor);
49 uint32_t mMaxItems MOZ_GUARDED_BY(mMonitor);
50 bool mHasCommit;
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;
66 } // namespace widget
67 } // namespace mozilla
69 #endif /* __JumpListBuilder_h__ */