vselectiondesc.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2002, The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library 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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "vselectiondesc.h"
21#include "vselection.h"
22#include "vgroup.h"
23#include "vtext.h"
24#include "vimage.h"
25#include "vcomposite.h"
26#include <kdebug.h>
27#include <tdelocale.h>
28
29void
31{
32 if( selection.objects().count() == 1 )
33 VVisitor::visitVSelection( selection );
34 else
35 m_desc = i18n( "One object", "%n objects", selection.objects().count() );
36}
37
38void
40{
41 m_desc = m_shortdesc = !composite.name().isEmpty() ? composite.name() : i18n( "path" );
42}
43
44void
46{
47 m_desc = i18n( "One group, containing one object", "One group, containing %n objects", group.objects().count() );
48 m_shortdesc = !group.name().isEmpty() ? group.name() : i18n( "group" );
49}
50
51void
53{
54 m_desc = m_shortdesc = !text.name().isEmpty() ? text.name() : i18n( "text" );
55}
56
57void
59{
60 m_desc = m_shortdesc = !img.name().isEmpty() ? img.name() : i18n( "image" );
61}
62
Base class for all sort of VObject conglomerats.
Definition vgroup.h:35
const VObjectList & objects() const
Read only access to the grouped objects.
Definition vgroup.h:110
virtual TQString name() const
Returns the name of the object.
Definition vobject.cpp:225
A composite path consists of one or many subpaths.
Definition vcomposite.h:48
virtual void visitVSelection(VSelection &)
Visit method for a VSelection.
virtual void visitVPath(VPath &)
Visit method for a VPath.
virtual void visitVGroup(VGroup &)
Visit method for a VGroup.
virtual void visitVImage(VImage &)
Visit method for a VImage.
virtual void visitVText(VText &)
Visit method for a VText.
VSelection manages a set of selected vobjects.
Definition vselection.h:62
const VObjectList & objects() const
Read only access to the selected objects.
Definition vselection.h:136
virtual void visitVSelection(VSelection &selection)
Visit method for a VSelection.
Definition vvisitor.cpp:91