electron/shell/browser/ui/win/notify_icon_host.h

71 lines
1.8 KiB
C
Raw Normal View History

// Copyright (c) 2014 GitHub, Inc.
2014-06-03 03:25:09 +00:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
2019-06-19 20:56:58 +00:00
#ifndef SHELL_BROWSER_UI_WIN_NOTIFY_ICON_HOST_H_
#define SHELL_BROWSER_UI_WIN_NOTIFY_ICON_HOST_H_
2014-06-03 03:25:09 +00:00
#include <windows.h>
#include <vector>
2016-05-23 07:39:19 +00:00
#include "base/macros.h"
#include "base/optional.h"
#include "shell/common/gin_converters/guid_converter.h"
const GUID GUID_DEFAULT = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
2014-06-03 03:25:09 +00:00
namespace electron {
2014-06-03 03:25:09 +00:00
class NotifyIcon;
class NotifyIconHost {
public:
NotifyIconHost();
~NotifyIconHost();
NotifyIcon* CreateNotifyIcon(base::Optional<UUID> guid);
2014-06-03 03:25:09 +00:00
void Remove(NotifyIcon* notify_icon);
private:
typedef std::vector<NotifyIcon*> NotifyIcons;
// Static callback invoked when a message comes in to our messaging window.
2018-04-18 01:44:10 +00:00
static LRESULT CALLBACK WndProcStatic(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam);
LRESULT CALLBACK WndProc(HWND hwnd,
UINT message,
WPARAM wparam,
LPARAM lparam);
2014-06-03 03:25:09 +00:00
UINT NextIconId();
// The unique icon ID we will assign to the next icon.
UINT next_icon_id_ = 1;
2014-06-03 03:25:09 +00:00
// List containing all active NotifyIcons.
NotifyIcons notify_icons_;
// The window class of |window_|.
ATOM atom_ = 0;
2014-06-03 03:25:09 +00:00
// The handle of the module that contains the window procedure of |window_|.
HMODULE instance_ = nullptr;
2014-06-03 03:25:09 +00:00
// The window used for processing events.
HWND window_ = nullptr;
2014-06-03 03:25:09 +00:00
// The message ID of the "TaskbarCreated" message, sent to us when we need to
// reset our status icons.
UINT taskbar_created_message_ = 0;
2014-06-03 03:25:09 +00:00
DISALLOW_COPY_AND_ASSIGN(NotifyIconHost);
};
} // namespace electron
2014-06-03 03:25:09 +00:00
2019-06-19 20:56:58 +00:00
#endif // SHELL_BROWSER_UI_WIN_NOTIFY_ICON_HOST_H_