3
* Copyright (C) 2001-2004 Murray Cumming
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#ifndef GLOM_MODE_DESIGN_PRINT_LAYOUTS_CANVAS_LAYOUT_ITEM_H
22
#define GLOM_MODE_DESIGN_PRINT_LAYOUTS_CANVAS_LAYOUT_ITEM_H
24
#include <glom/utility_widgets/canvas/canvas_group_resizable.h>
25
#include <glom/libglom/data_structure/layout/layoutitem.h>
26
#include <libgdamm/value.h>
31
class CanvasTextMovable;
32
class FieldFormatting;
33
class LayoutItem_Portal;
35
/** This has the appropriate child canvas item, depending on the type of the child LayoutItem.
37
class CanvasLayoutItem : public CanvasGroupResizable
41
CanvasLayoutItem(const sharedptr<LayoutItem>& layout_item);
42
virtual ~CanvasLayoutItem();
46
static Glib::RefPtr<CanvasLayoutItem> create();
48
//Creates a new canvas item, with an appropriate child canvas item,
49
//and sets the position and size of this canvas item to the position in the LayoutItem.
50
static Glib::RefPtr<CanvasLayoutItem> create(const sharedptr<LayoutItem>& layout_item);
52
sharedptr<LayoutItem> get_layout_item();
54
//Create an appropriate child canvas item,
55
//and sets the position and size of this canvas item to the position in the LayoutItem.
56
void set_layout_item(const sharedptr<LayoutItem>& layout_item);
58
/// Make the canvas item show actual data instead of, for instance, a field name.
59
void set_db_data(const Gnome::Gda::Value& value);
61
/// Hide the missing-image pixbuf from images, for instance.
62
void remove_empty_indicators();
64
static int get_rows_count_for_portal(const sharedptr<const LayoutItem_Portal>& portal, double& row_height);
67
/// Create the appropriate inner canvas item to represent the layout item.
68
static Glib::RefPtr<CanvasItemMovable> create_canvas_item_for_layout_item(const sharedptr<LayoutItem>& layout_item);
70
static void check_and_apply_formatting(const Glib::RefPtr<CanvasTextMovable>& canvas_item, FieldFormatting& formatting);
74
sharedptr<LayoutItem> m_layout_item;
80
#endif //GLOM_MODE_DESIGN_PRINT_LAYOUTS_CANVAS_LAYOUT_ITEM_H