## FmJob

FmJob

## Synopsis

    struct              FmJob;
    gpointer            (*FmJobCallMainThreadFunc)          (FmJob *job,
                                                             gpointer user_data);
    struct              FmJobClass;
    gint                fm_job_ask                          (FmJob *job,
                                                             const char *question,
                                                             ...);
    gint                fm_job_ask_valist                   (FmJob *job,
                                                             const char *question,
                                                             va_list options);
    gint                fm_job_askv                         (FmJob *job,
                                                             const char *question,
                                                             const char **options);
    gpointer            fm_job_call_main_thread             (FmJob *job,
                                                             FmJobCallMainThreadFunc func,
                                                             gpointer user_data);
    void                fm_job_cancel                       (FmJob *job);
    void                fm_job_emit_cancelled               (FmJob *job);
    FmJobErrorAction    fm_job_emit_error                   (FmJob *job,
                                                             GError *err,
                                                             FmJobErrorSeverity severity);
    void                fm_job_emit_finished                (FmJob *job);
    void                fm_job_finish                       (FmJob *job);
    GCancellable *      fm_job_get_cancellable              (FmJob *job);
    void                fm_job_init_cancellable             (FmJob *job);
    gboolean            fm_job_is_cancelled                 (FmJob *job);
    gboolean            fm_job_is_running                   (FmJob *job);
    gboolean            fm_job_run_async                    (FmJob *job);
    gboolean            fm_job_run_sync                     (FmJob *job);
    gboolean            fm_job_run_sync_with_mainloop       (FmJob *job);
    void                fm_job_set_cancellable              (FmJob *job,
                                                             GCancellable *cancellable);

## Object Hierarchy

      GObject
       +----FmJob
             +----FmDeepCountJob
             +----FmDirListJob
             +----FmFileInfoJob
             +----FmFileOpsJob
             +----FmSimpleJob

## Signals

      "ask"                                            : Run Last
      "cancelled"                                      : Run First
      "error"                                          : Run Last
      "finished"                                       : Run First

## Description

## Details

### struct FmJob

    struct FmJob;

### FmJobCallMainThreadFunc ()

    gpointer            (*FmJobCallMainThreadFunc)          (FmJob *job,
                                                             gpointer user_data);

### struct FmJobClass

    struct FmJobClass {
    	GObjectClass parent_class;

    	void (*finished)(FmJob* job);
    	FmJobErrorAction (*error)(FmJob* job, GError* err, FmJobErrorSeverity severity);
    	void (*cancelled)(FmJob* job);
    	gint (*ask)(FmJob* job, const char* question, gint options);

    	gboolean (*run_async)(FmJob* job);
    	gboolean (*run)(FmJob* job);
    	void (*cancel)(FmJob* job);
    };

### fm_job_ask ()

    gint                fm_job_ask                          (FmJob *job,
                                                             const char *question,
                                                             ...);

### fm_job_ask_valist ()

    gint                fm_job_ask_valist                   (FmJob *job,
                                                             const char *question,
                                                             va_list options);

### fm_job_askv ()

    gint                fm_job_askv                         (FmJob *job,
                                                             const char *question,
                                                             const char **options);

### fm_job_call_main_thread ()

    gpointer            fm_job_call_main_thread             (FmJob *job,
                                                             FmJobCallMainThreadFunc func,
                                                             gpointer user_data);

### fm_job_cancel ()

    void                fm_job_cancel                       (FmJob *job);

### fm_job_emit_cancelled ()

    void                fm_job_emit_cancelled               (FmJob *job);

### fm_job_emit_error ()

    FmJobErrorAction    fm_job_emit_error                   (FmJob *job,
                                                             GError *err,
                                                             FmJobErrorSeverity severity);

### fm_job_emit_finished ()

    void                fm_job_emit_finished                (FmJob *job);

### fm_job_finish ()

    void                fm_job_finish                       (FmJob *job);

### fm_job_get_cancellable ()

    GCancellable *      fm_job_get_cancellable              (FmJob *job);

### fm_job_init_cancellable ()

    void                fm_job_init_cancellable             (FmJob *job);

### fm_job_is_cancelled ()

    gboolean            fm_job_is_cancelled                 (FmJob *job);

### fm_job_is_running ()

    gboolean            fm_job_is_running                   (FmJob *job);

### fm_job_run_async ()

    gboolean            fm_job_run_async                    (FmJob *job);

### fm_job_run_sync ()

    gboolean            fm_job_run_sync                     (FmJob *job);

### fm_job_run_sync_with_mainloop ()

    gboolean            fm_job_run_sync_with_mainloop       (FmJob *job);

### fm_job_set_cancellable ()

    void                fm_job_set_cancellable              (FmJob *job,
                                                             GCancellable *cancellable);

## Signal Details

### The `"ask"` signal

    gint                user_function                      (FmJob   *fmjob,
                                                            gpointer arg1,
                                                            gpointer arg2,
                                                            gpointer user_data)      : Run Last

### The `"cancelled"` signal

    void                user_function                      (FmJob   *fmjob,
                                                            gpointer user_data)      : Run First

### The `"error"` signal

    gint                user_function                      (FmJob   *fmjob,
                                                            gpointer arg1,
                                                            gint     arg2,
                                                            gpointer user_data)      : Run Last

### The `"finished"` signal

    void                user_function                      (FmJob   *fmjob,
                                                            gpointer user_data)      : Run First