1 /*
2  * Copyright © 2004-2010 Jens Oknelid, paskharen@gmail.com
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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 this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * In addition, as a special exception, compiling, linking, and/or
19  * using OpenSSL with this program is allowed.
20  */
21 
22 #pragma once
23 
24 #include "entry.hh"
25 
26 class BookEntry : public Entry
27 {
28     public:
29         BookEntry(const EntryType type = EntryType::NONE, const std::string &text = "", const std::string &ui = "", const std::string &id = "");
~BookEntry()30         virtual ~BookEntry() { }
31 
32         GtkWidget *getContainer();
getLabelBox()33         GtkWidget *getLabelBox() { return labelBox; }
getCloseButton()34         GtkWidget *getCloseButton() { return closeButton; }
getTabMenuItem()35         GtkWidget *getTabMenuItem() { return tabMenuItem; }
36         void setIcon_gui(const EntryType type);
37         void setIcon_gui(const std::string &stock);
38         void setLabel_gui(std::string text);
39         const std::string& getLabelText();
40         void setBold_gui();
41         void setUrgent_gui();
42         void setActive_gui();
43         bool isActive_gui();
44         virtual void show() = 0;
45 
46     private:
47         void updateLabel_gui();
48 
49         std::string labelText;
50         std::string truncatedLabelText;
51         GtkWidget *eventBox;
52         GtkWidget *labelBox;
53         GtkWidget *tabMenuItem;
54         GtkWidget *closeButton;
55         GtkLabel *label;
56 
57         bool bold;
58         bool urgent;
59         static const glong labelSize = 20; ///@todo: make a preference?
60         GtkWidget *icon;
61 };
62