QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ElementCollectionHandler Class Reference

The ElementCollectionHandler class Provide several method to copy element or directory from a collection to another collection. More...

#include <elementcollectionhandler.h>

Collaboration diagram for ElementCollectionHandler:
Collaboration graph

Public Member Functions

 ElementCollectionHandler ()
 ElementCollectionHandler::ElementCollectionHandler.
 
 ~ElementCollectionHandler ()
 
ElementsLocation copy (ElementsLocation &source, ElementsLocation &destination)
 ElementCollectionHandler::copy Copy the content of collection represented by source to the collection represented by destination. Destination must be a directory, else the copy do nothing and return a null ElementLocation if destination have an item with the same name of source, a dialog ask to user what to do.
 
ElementsLocation createDir (ElementsLocation &parent, const QString &name, const NamesList &name_list)
 ElementCollectionHandler::createDir Create a directory with name as child of parent. Parent must be a directory.
 
bool importFromProject (QETProject *project, ElementsLocation &location)
 ElementCollectionHandler::importFromProject Import the element represented by location to the embedded collection of project at the same path. location must represente an element owned by a project embedded collection.
 
bool setNames (ElementsLocation &location, const NamesList &name_list)
 ElementCollectionHandler::setNames Set the names stored in name_list as the names of the item represented by location.
 

Private Attributes

ECHStrategym_strategy = nullptr
 

Detailed Description

The ElementCollectionHandler class Provide several method to copy element or directory from a collection to another collection.

Constructor & Destructor Documentation

◆ ElementCollectionHandler()

ElementCollectionHandler::ElementCollectionHandler ( )

◆ ~ElementCollectionHandler()

ElementCollectionHandler::~ElementCollectionHandler ( )

Member Function Documentation

◆ copy()

ElementsLocation ElementCollectionHandler::copy ( ElementsLocation source,
ElementsLocation destination 
)

ElementCollectionHandler::copy Copy the content of collection represented by source to the collection represented by destination. Destination must be a directory, else the copy do nothing and return a null ElementLocation if destination have an item with the same name of source, a dialog ask to user what to do.

Parameters
source
destination
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDir()

ElementsLocation ElementCollectionHandler::createDir ( ElementsLocation parent,
const QString &  name,
const NamesList name_list 
)

ElementCollectionHandler::createDir Create a directory with name as child of parent. Parent must be a directory.

Parameters
parent: parent of the dir to create
name: name of directory to create
name_list: translations of the directory name
Returns
: ElementsLocation that represent the new directory, location can be null if an error was occurred
Here is the call graph for this function:
Here is the caller graph for this function:

◆ importFromProject()

bool ElementCollectionHandler::importFromProject ( QETProject project,
ElementsLocation location 
)

ElementCollectionHandler::importFromProject Import the element represented by location to the embedded collection of project at the same path. location must represente an element owned by a project embedded collection.

Parameters
project: project where copy the element
location: location to copy
Returns
true if import with success
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setNames()

bool ElementCollectionHandler::setNames ( ElementsLocation location,
const NamesList name_list 
)

ElementCollectionHandler::setNames Set the names stored in name_list as the names of the item represented by location.

Parameters
location: location to change the names
name_list: NamesList to use
Returns
return true if success
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_strategy

ECHStrategy* ElementCollectionHandler::m_strategy = nullptr
private

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