summaryrefslogtreecommitdiff
path: root/libtemplate/templateloopfunction.h
blob: 1a28c65655b95c21215452c7a51159b11bde630b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __TEMPLATELOOPFUNCTION_H
#define __TEMPLATELOOPFUNCTION_H

#include "templatefunction.h"

using namespace std;

// --- cTemplateLoopFunction -------------------------------------------------------------

class cTemplateLoopFunction : public cTemplateFunction {
private:
    vector<cTemplateFunction*> functions;
    vector<cTemplateFunction*>::iterator funcIt;
    bool ReplaceWidthFunctions(void);
    bool ReplaceHeightFunctions(void);
public:
    cTemplateLoopFunction(void);
    virtual ~cTemplateLoopFunction(void);
    void AddFunction(string name, vector<pair<string, string> > &params);
    void CalculateLoopFuncParameters(void);
    void InitIterator(void);
    cTemplateFunction *GetNextFunction(void);
    void ClearDynamicParameters(void);
    void ParseDynamicParameters(map <string,string> *tokens);
    int GetLoopElementsWidth(void);
    int GetLoopElementsHeight(void);
    int GetContainerWidth(void) { return containerWidth; };
    int GetContainerHeight(void) { return containerHeight; };
    int CalculateHeight(map < string, vector< map< string, string > > > *loopTokens);
    bool Ready(void);
    void Debug(void);
};

#endif //__TEMPLATELOOPFUNCTION_H