Statistics
| Branch: | Revision:

root / src / org.omnetpp.ide.nativelibs / jprogressmonitor.h @ 0418c1a0

History | View | Annotate | Download (1.4 KB)

1
//=========================================================================
2
//  JPROGRESSMONITOR.H - part of
3
//
4
//                  OMNeT++/OMNEST
5
//           Discrete System Simulation in C++
6
//
7
//=========================================================================
8

    
9
/*--------------------------------------------------------------*
10
  Copyright (C) 1992-2005 Andras Varga
11

12
  This file is distributed WITHOUT ANY WARRANTY. See the file
13
  `license' for details on this and other legal matters.
14
*--------------------------------------------------------------*/
15

    
16
#ifndef _JPROGRESSMONITOR_H_
17
#define _JPROGRESSMONITOR_H_
18

    
19
#include <jni.h>
20
#include "progressmonitor.h"
21

    
22
/*
23
 * Implementation of the IProgressMonitor interface
24
 * that delegates to an org.eclipse.core.runtime.IProgressMonitor
25
 * java object.
26
 */
27
class JniProgressMonitor : public IProgressMonitor
28
{
29
        private:
30
                jobject jProgressMonitor;
31
                jmethodID beginTaskID, doneID, isCanceledID,
32
                                        setCanceledID, subTaskID, workedID;
33

    
34
                JNIEnv *env;
35
        public:
36

    
37
        JniProgressMonitor() : env(NULL) {}
38
        JniProgressMonitor(jobject jProgressMonitor, JNIEnv *env);
39
        virtual ~JniProgressMonitor();
40

    
41
        virtual void beginTask(std::string name, int totalWork);
42
        virtual void done();
43
        virtual bool isCanceled();
44
        virtual void setCanceled(bool value);
45
        virtual void subTask(std::string name);
46
        virtual void worked(int work);
47
};
48

    
49
#endif
50