Back to index

scribus-ng  1.3.4.dfsg+svn20071115
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
ResourceCollection Class Reference

A simple structure which holds the names of all resources & styles used in a doc or part of a document. More...

#include <resourcecollection.h>

List of all members.

Public Member Functions

void collectFont (const QString &name)
void collectPattern (const QString &name)
void collectColor (const QString &name)
void collectStyle (const QString &name)
void collectCharStyle (const QString &name)
void collectLineStyle (const QString &name)
void mapFont (const QString &oldname, const QString &newname)
void mapPattern (const QString &oldname, const QString &newname)
void mapColor (const QString &oldname, const QString &newname)
void mapStyle (const QString &oldname, const QString &newname)
void mapCharStyle (const QString &oldname, const QString &newname)
void mapLineStyle (const QString &oldname, const QString &newname)
void mapFonts (const QMap< QString, QString > &newnames)
void mapPatterns (const QMap< QString, QString > &newnames)
void mapColors (const QMap< QString, QString > &newnames)
void mapStyles (const QMap< QString, QString > &newnames)
void mapCharStyles (const QMap< QString, QString > &newnames)
void mapLineStyles (const QMap< QString, QString > &newnames)
const QMap< QString, QString > & fonts ()
const QMap< QString, QString > & patterns ()
const QMap< QString, QString > & colors ()
const QMap< QString, QString > & styles ()
const QMap< QString, QString > & charStyles ()
const QMap< QString, QString > & lineStyles ()
QValueList< QString > fontNames () const
QValueList< QString > patternNames () const
QValueList< QString > colorNames () const
QValueList< QString > styleNames () const
QValueList< QString > charStyleNames () const
QValueList< QString > lineStyleNames () const
void makeNamedResourcesUnique (ResourceCollection &other)

Static Public Member Functions

static void makeUnique (QMap< QString, QString > &newNames, const QValueList< QString > existingNames)

Public Attributes

SCFonts * availableFonts
ColorList * availableColors

Private Attributes

QMap< QString, QString > m_fonts
QMap< QString, QString > m_patterns
QMap< QString, QString > m_colors
QMap< QString, QString > m_pstyles
QMap< QString, QString > m_cstyles
QMap< QString, QString > m_linestyles

Detailed Description

A simple structure which holds the names of all resources & styles used in a doc or part of a document.

Also holds pointers to the doc's fontset and colorset. The names are stored as a QMap<QString,QString>. When a doc is queried for it's used resources, these maps get an entry (nam -> nam) for each used resource 'nam'. You can replace resources consistently by changing these maps and asking the doc to use the altered maps to change all old names to the new one. Operations:

Definition at line 40 of file resourcecollection.h.


Member Function Documentation

QValueList<QString> ResourceCollection::charStyleNames ( ) const [inline]

Definition at line 75 of file resourcecollection.h.

{ return m_cstyles.keys(); }
const QMap<QString, QString>& ResourceCollection::charStyles ( ) [inline]

Definition at line 68 of file resourcecollection.h.

{ return m_cstyles; }
void ResourceCollection::collectCharStyle ( const QString &  name) [inline]

Definition at line 47 of file resourcecollection.h.

{ if (!name.isEmpty()) m_cstyles.insert(name,name); }
void ResourceCollection::collectColor ( const QString &  name) [inline]

Definition at line 45 of file resourcecollection.h.

{ if (!name.isEmpty()) m_colors.insert(name,name); }
void ResourceCollection::collectFont ( const QString &  name) [inline]

Definition at line 43 of file resourcecollection.h.

{ if (!name.isEmpty()) m_fonts.insert(name,name); }
void ResourceCollection::collectLineStyle ( const QString &  name) [inline]

Definition at line 48 of file resourcecollection.h.

{ if (!name.isEmpty()) m_linestyles.insert(name,name); }
void ResourceCollection::collectPattern ( const QString &  name) [inline]

Definition at line 44 of file resourcecollection.h.

{ if (!name.isEmpty()) m_patterns.insert(name,name); }
void ResourceCollection::collectStyle ( const QString &  name) [inline]

Definition at line 46 of file resourcecollection.h.

{ if (!name.isEmpty()) m_pstyles.insert(name,name); }
QValueList<QString> ResourceCollection::colorNames ( ) const [inline]

Definition at line 73 of file resourcecollection.h.

{ return m_colors.keys(); }
const QMap<QString, QString>& ResourceCollection::colors ( ) [inline]

Definition at line 66 of file resourcecollection.h.

{ return m_colors; }
QValueList<QString> ResourceCollection::fontNames ( ) const [inline]

Definition at line 71 of file resourcecollection.h.

{ return m_fonts.keys(); }
const QMap<QString, QString>& ResourceCollection::fonts ( ) [inline]

Definition at line 64 of file resourcecollection.h.

{ return m_fonts; }
QValueList<QString> ResourceCollection::lineStyleNames ( ) const [inline]

Definition at line 76 of file resourcecollection.h.

{ return m_linestyles.keys(); }
const QMap<QString, QString>& ResourceCollection::lineStyles ( ) [inline]

Definition at line 69 of file resourcecollection.h.

{ return m_linestyles; }
static void ResourceCollection::makeUnique ( QMap< QString, QString > &  newNames,
const QValueList< QString >  existingNames 
) [static]
void ResourceCollection::mapCharStyle ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 54 of file resourcecollection.h.

{ m_cstyles.insert(oldname, newname); }
void ResourceCollection::mapCharStyles ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 61 of file resourcecollection.h.

{ m_cstyles = newnames; }
void ResourceCollection::mapColor ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 52 of file resourcecollection.h.

{ m_colors.insert(oldname, newname); }
void ResourceCollection::mapColors ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 59 of file resourcecollection.h.

{ m_colors = newnames; }
void ResourceCollection::mapFont ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 50 of file resourcecollection.h.

{ m_fonts.insert(oldname, newname); }
void ResourceCollection::mapFonts ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 57 of file resourcecollection.h.

{ m_fonts = newnames; }
void ResourceCollection::mapLineStyle ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 55 of file resourcecollection.h.

{ m_linestyles.insert(oldname, newname); }
void ResourceCollection::mapLineStyles ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 62 of file resourcecollection.h.

{ m_linestyles = newnames; }
void ResourceCollection::mapPattern ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 51 of file resourcecollection.h.

{ m_patterns.insert(oldname, newname); }
void ResourceCollection::mapPatterns ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 58 of file resourcecollection.h.

{ m_patterns = newnames; }
void ResourceCollection::mapStyle ( const QString &  oldname,
const QString &  newname 
) [inline]

Definition at line 53 of file resourcecollection.h.

{ m_pstyles.insert(oldname, newname); }
void ResourceCollection::mapStyles ( const QMap< QString, QString > &  newnames) [inline]

Definition at line 60 of file resourcecollection.h.

{ m_pstyles = newnames; }
QValueList<QString> ResourceCollection::patternNames ( ) const [inline]

Definition at line 72 of file resourcecollection.h.

{ return m_patterns.keys(); }
const QMap<QString, QString>& ResourceCollection::patterns ( ) [inline]

Definition at line 65 of file resourcecollection.h.

{ return m_patterns; }
QValueList<QString> ResourceCollection::styleNames ( ) const [inline]

Definition at line 74 of file resourcecollection.h.

{ return m_pstyles.keys(); }
const QMap<QString, QString>& ResourceCollection::styles ( ) [inline]

Definition at line 67 of file resourcecollection.h.

{ return m_pstyles; }

Member Data Documentation

Definition at line 84 of file resourcecollection.h.

Definition at line 83 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_colors [private]

Definition at line 88 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_cstyles [private]

Definition at line 90 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_fonts [private]

Definition at line 86 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_linestyles [private]

Definition at line 91 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_patterns [private]

Definition at line 87 of file resourcecollection.h.

QMap<QString,QString> ResourceCollection::m_pstyles [private]

Definition at line 89 of file resourcecollection.h.


The documentation for this class was generated from the following file: