libadblockplus
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Notification.h
1 /*
2  * This file is part of Adblock Plus <https://adblockplus.org/>,
3  * Copyright (C) 2006-present eyeo GmbH
4  *
5  * Adblock Plus is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 3 as
7  * published by the Free Software Foundation.
8  *
9  * Adblock Plus is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ADBLOCK_PLUS_NOTIFICATION_H
19 #define ADBLOCK_PLUS_NOTIFICATION_H
20 
21 #include <string>
22 #include <vector>
23 #include <memory>
24 
25 namespace AdblockPlus
26 {
27  class FilterEngine;
32  {
33  NOTIFICATION_TYPE_INFORMATION,
34  NOTIFICATION_TYPE_QUESTION,
35  NOTIFICATION_TYPE_RELENTLESS,
36  NOTIFICATION_TYPE_CRITICAL
37  };
38 
44  {
45  std::string title;
46  std::string message;
47  };
48 
52  class Notification: public JsValue
53  {
54  friend class FilterEngine;
55  protected:
60  explicit Notification(JsValue&& jsValue);
61  public:
65  Notification(const Notification& src);
66 
71 
75  Notification& operator=(const Notification& src);
76 
81 
86  NotificationType GetType() const;
87 
93 
98  std::vector<std::string> GetLinks() const;
99 
104  void MarkAsShown();
105  private:
106  };
107 }
108 
109 #endif
void MarkAsShown()
Marks this notification as shown.
NotificationType
Possible notification types.
Definition: Notification.h:31
NotificationTexts GetTexts() const
Retrieves the title and message of this notification.
Contains notification title and message.
Definition: Notification.h:43
Wrapper for JavaScript values.
Definition: JsValue.h:54
Main component of libadblockplus.
Definition: FilterEngine.h:192
Main namespace of libadblockplus.
Definition: ActiveObject.h:23
Notification & operator=(const Notification &src)
Assignment operator.
Wrapper for an Adblock Plus notification object.
Definition: Notification.h:52
std::vector< std::string > GetLinks() const
Retrieves the URLs which should be mapped to the links in the message.
Notification(JsValue &&jsValue)
Constructor.
NotificationType GetType() const
Retrieves the type of this notification.