1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: listviewbuilder.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef LISTVIEWBUILDER_HXX_INCLUDED
32 #define LISTVIEWBUILDER_HXX_INCLUDED
34 //------------------------------------
36 //------------------------------------
39 #pragma warning(push, 1)
48 #include "document_statistic.hxx"
50 //------------------------------------
52 //------------------------------------
54 class list_view_builder
;
55 typedef std::auto_ptr
<list_view_builder
> list_view_builder_ptr
;
57 // factory method for list_view_builder
58 list_view_builder_ptr
create_list_view_builder(
59 HWND hwnd_lv
, const std::wstring
& col1
, const std::wstring
& col2
);
61 //------------------------------------
63 //------------------------------------
65 class list_view_builder
68 virtual ~list_view_builder();
70 void build(statistic_group_list_t
& gl
);
75 const std::wstring
& column1_title
,
76 const std::wstring
& column2_title
);
78 virtual void setup_list_view();
79 virtual void insert_group(const std::wstring
& title
);
80 virtual void insert_item(const std::wstring
& title
, const std::wstring
& value
, bool is_editable
);
82 HWND
get_list_view() const;
83 int get_current_row() const;
89 std::wstring column1_title_
;
90 std::wstring column2_title_
;
92 friend list_view_builder_ptr
create_list_view_builder(HWND hwnd_lv
, const std::wstring
& col1
, const std::wstring
& col2
);
95 //------------------------------------
97 //------------------------------------
99 class winxp_list_view_builder
: public list_view_builder
102 winxp_list_view_builder(
104 const std::wstring
& column1_title
,
105 const std::wstring
& column2_title
);
107 virtual void setup_list_view();
108 virtual void insert_group(const std::wstring
& name
);
109 virtual void insert_item(const std::wstring
& title
, const std::wstring
& value
, bool is_editable
);
115 friend list_view_builder_ptr
create_list_view_builder(HWND hwnd_lv
, const std::wstring
& col1
, const std::wstring
& col2
);