--- content_complete.module.orig	2009-02-02 11:29:40.984375000 +0100
+++ content_complete.module	2009-02-02 12:55:23.218750000 +0100
@@ -433,4 +433,48 @@ function theme_content_complete_profile_
   }
   
   return $output;
+}
+
+/**
+ * Rules hook implementation.
+ */
+function content_complete_rules_condition_info() {
+  return array(
+    'content_complete_completeness_percentage' => array(
+      'label' => t('Content Complete % is >= than'),
+      'arguments' => array(
+        'user' => array('type' => 'user', 'label' => t('User'))
+      ),
+      'module' => 'Content Complete',
+      'eval input' => array('percentage'),
+    ),
+  );
+}
+
+/**
+ * Rules Condition form configuration - set the % to compare
+ */
+function content_complete_completeness_percentage_form($settings = array(), &$form) {
+  $form['settings']['percentage'] = array(
+    '#type' => 'textfield',
+    '#title' => t('% to compare'),
+    '#default_value' => isset($settings['percentage']) ? $settings['percentage'] : '',
+    '#description' => t('The % to compare if >=')
+  );
+  $form['settings']['type'] = array(
+    '#type' => 'select',
+    '#title' => t('Content Type to analyze'),
+    '#options' => node_get_types('names'),
+    '#default_value' => isset($settings['type']) ? $settings['type'] : '',
+    '#description' => t('Content Type to analyze'),
+    '#required' => TRUE,
+  );
+}
+
+/**
+ * Rules Condition - Content Complete % is >= than
+ */
+function content_complete_completeness_percentage($account, $settings) {
+  $complete = content_complete_get_data($settings['type']);
+  return ($complete['percent'] >= $settings['percentage']);
 }
\ No newline at end of file
