1 /* 2 * Copyright © 2004-2008 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 #ifndef WULFOR_BOOK_ENTRY_HH 23 #define WULFOR_BOOK_ENTRY_HH 24 25 #include "entry.hh" 26 27 class BookEntry : public Entry 28 { 29 public: 30 BookEntry(const EntryType type, const std::string &text, const std::string &glade, const std::string &id = ""); ~BookEntry()31 virtual ~BookEntry() {} 32 33 GtkWidget *getContainer(); getLabelBox()34 GtkWidget *getLabelBox() { return labelBox; } getCloseButton()35 GtkWidget *getCloseButton() { return closeButton; } getTabMenuItem()36 GtkWidget *getTabMenuItem() { return tabMenuItem; } 37 void setLabel_gui(std::string text); 38 const std::string& getLabelText(); 39 void setIcon_gui(const std::string &iconName = ""); 40 void setBold_gui(); 41 void setUrgent_gui(); 42 void setActive_gui(); 43 bool isActive_gui(); 44 bool isSelected_gui(); 45 virtual void show() = 0; 46 47 private: BookEntry()48 BookEntry() {} 49 void updateLabel_gui(); 50 51 std::string labelText; 52 std::string truncatedLabelText; 53 GtkWidget *eventBox; 54 GtkWidget *icon; 55 GtkWidget *labelBox; 56 GtkWidget *tabMenuItem; 57 GtkWidget *closeButton; 58 GtkLabel *label; 59 GtkTooltips *tips; 60 static GSList *group; 61 bool bold; 62 bool urgent; 63 static const glong labelSize = 20; ///@todo: make a preference? 64 }; 65 66 #else 67 class BookEntry; 68 #endif 69