OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_OPTIONS_OPTIONS_LAYOUT_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_OPTIONS_OPTIONS_LAYOUT_GTK_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <gtk/gtk.h> |
| 10 #include <string> |
| 11 |
| 12 #include "base/basictypes.h" |
| 13 |
| 14 class OptionsLayoutBuilderGtk { |
| 15 public: |
| 16 virtual ~OptionsLayoutBuilderGtk() {} |
| 17 |
| 18 GtkWidget* get_page_widget() { |
| 19 return page_; |
| 20 } |
| 21 |
| 22 // Adds an option group to the table. Handles layout and the placing of |
| 23 // separators between groups. If expandable is true, the content widget will |
| 24 // be allowed to expand and fill any extra space when the dialog is resized. |
| 25 virtual void AddOptionGroup(const std::string& title, GtkWidget* content, |
| 26 bool expandable) = 0; |
| 27 |
| 28 // Adds a widget without title or special layout. If expandable is true, the |
| 29 // content widget will be allowed to expand and fill any extra space when the |
| 30 // dialog is resized. |
| 31 virtual void AddWidget(GtkWidget* content, bool expandable) = 0; |
| 32 |
| 33 // Creates a default option layout builder. The default layout builder |
| 34 // follows the GNOME HIG. |
| 35 static OptionsLayoutBuilderGtk* Create(); |
| 36 |
| 37 // Creates a compact option layout builder, if the screen is compact. |
| 38 // Otherwise, creates a default one. |
| 39 static OptionsLayoutBuilderGtk* CreateOptionallyCompactLayout(); |
| 40 |
| 41 protected: |
| 42 // The parent widget |
| 43 GtkWidget* page_; |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_UI_GTK_OPTIONS_OPTIONS_LAYOUT_GTK_H_ |
OLD | NEW |