summaryrefslogtreecommitdiffstats
path: root/akregator/src/mk4storage/metakit/src/custom.h
blob: 80555d3b68deb556f2b892718b20b6c22ee509db (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// custom.h --
// $Id$
// This is part of Metakit, the homepage is http://www.equi4.com/metakit/

/** @file
 * Encapsulation of many custom viewer classes
 */

#ifndef __CUSTOM_H__
#define __CUSTOM_H__

#ifndef __FIELD_H__
#include "field.h"
#endif
#ifndef __STORE_H__
#include "handler.h"
#endif

/////////////////////////////////////////////////////////////////////////////

class c4_CustomSeq : public c4_HandlerSeq
{
  c4_CustomViewer* _viewer;
  bool _inited;

public:
  c4_CustomSeq (c4_CustomViewer* viewer_);
  virtual ~c4_CustomSeq ();

  virtual int NumRows() const;
    
  virtual bool RestrictSearch(c4_Cursor, int&, int&);

  virtual void InsertAt(int, c4_Cursor, int =1);
  virtual void RemoveAt(int, int =1);
  virtual void Move(int from_, int);

  bool DoGet(int row_, int col_, c4_Bytes& buf_) const;
  void DoSet(int row_, int col_, const c4_Bytes& buf_);

private: // this *is* used, as override
  virtual c4_Handler* CreateHandler(const c4_Property&);
};

/////////////////////////////////////////////////////////////////////////////

  extern c4_CustomViewer* f4_CustSlice(c4_Sequence&, int, int , int);
  extern c4_CustomViewer* f4_CustProduct(c4_Sequence&, const c4_View&);
  extern c4_CustomViewer* f4_CustRemapWith(c4_Sequence&, const c4_View&);
  extern c4_CustomViewer* f4_CustPair(c4_Sequence&, const c4_View&);
  extern c4_CustomViewer* f4_CustConcat(c4_Sequence&, const c4_View&);
  extern c4_CustomViewer* f4_CustRename(c4_Sequence&, 
                      const c4_Property&, const c4_Property&);
  extern c4_CustomViewer* f4_CustGroupBy(c4_Sequence&, 
                      const c4_View&, const c4_Property&);
  extern c4_CustomViewer* f4_CustJoinProp(c4_Sequence&, 
                      const c4_ViewProp&, bool);
  extern c4_CustomViewer* f4_CustJoin(c4_Sequence&, 
                      const c4_View&, const c4_View&, bool);

/////////////////////////////////////////////////////////////////////////////

#endif